Skip to content

Instantly share code, notes, and snippets.

@budu
Created November 3, 2022 15:14
Show Gist options
  • Save budu/898484ea736fb0c79afd3f78b28594ee to your computer and use it in GitHub Desktop.
Save budu/898484ea736fb0c79afd3f78b28594ee to your computer and use it in GitHub Desktop.
DST fun!
> Time.new(2022,11,6) + 3.hours
=> 2022-11-06 02:00:00 -0500
> Time.new(2022,11,6) + 3.hours.in_days.days
=> 2022-11-06 02:00:00 -0500
> Time.new(2022,11,6) + 24.hours.in_days.days
=> 2022-11-07 00:00:00 -0500
> Time.zone.local(2022,11,6) + 3.hours
=> Sun, 06 Nov 2022 02:00:00 EST -05:00
> Time.zone.local(2022,11,6) + 3.hours.in_days.days
=> Sun, 06 Nov 2022 03:00:00 EST -05:00
> Time.zone.local(2022,11,6) + 24.hours.in_days.days
=> Mon, 07 Nov 2022 00:00:00 EST -05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment