Why Ruby sucks and Crystal not (time parsing)
Consider this in Ruby:
Time.parse("2018-06-30 10:00 +00:00") # it's ok
Time.parse("2018-06-31 10:00 +00:00") # it gives 2018-07-01, no error
Crystal version:
Time.parse("2018-06-30 10:00 +00:00", "%Y-%m-%d %H:%M %z") # it's ok
Time.parse("2018-06-31 10:00 +00:00", "%Y-%m-%d %H:%M %z") # Unhandled exception: Invalid time (ArgumentError)
Tweet