Methods
Public Instance methods
[ show source ]
# File activesupport/lib/active_support/core_ext/date_time/calculations.rb, line 23 23: def current 24: ::Time.zone_default ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime 25: end
DateTimes aren‘t aware of DST rules, so use a consistent non-DST offset when creating a DateTime with an offset in the local zone
[ show source ]
# File activesupport/lib/active_support/core_ext/date_time/calculations.rb, line 19 19: def local_offset 20: ::Time.local(2007).utc_offset.to_r / 86400 21: end