Ruby rails: dates and times

From wikinotes
Revision as of 16:08, 7 February 2024 by Will (talk | contribs) (Created page with "= timezones = <blockquote> <source lang="ruby"> tzinfo = ActiveSupport::TimeZone.find_tzinfo("America/Toronto") timezone = ActiveSupport::TimeZone.new(tzinfo) Time.parse("1970-01-01T10:00:00Z").in_timezone(timezone) </source> </blockquote><!-- timezones -->")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

timezones

tzinfo = ActiveSupport::TimeZone.find_tzinfo("America/Toronto")
timezone = ActiveSupport::TimeZone.new(tzinfo)

Time.parse("1970-01-01T10:00:00Z").in_timezone(timezone)