wikiti
10/2/2018 - 1:28 PM

Parse a datetime on any timezone

Parse any datetime string on any known timezone

# Fetch a Rails timezone, and use it to parse a string
ActiveSupport::TimeZone[time_zone].parse(str)

# For example:
ActiveSupport::TimeZone['Madrid'].parse('2018-08-30 14:36')
# Thu, 30 Aug 2018 14:36:00 CEST +02:00