-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Issue description
If ENV['TZ'] is unset, Fugit.parse('now') seems to incorrectly offset by the timezone offset from Time.zone.
How to reproduce
> Time.zone.now
=> Sat, 28 Jun 2025 22:45:09.571476714 PDT -07:00
> Fugit.parse('now').to_t
=> 2025-06-29 12:45:59 +0000
> Fugit.parse('now').to_s
=> "2025-06-29 05:46:12 -0700"
# issue seems to be Fugit, not EtOrbi:
> EtOrbi.now.to_s
=> "2025-06-28 22:49:22 -0700"
> EtOrbi.now.to_t
=> 2025-06-29 05:49:28 1252695/2097152 +0000
> ENV['TZ'] = "America/Los_Angeles"
=> "America/Los_Angeles"
> Fugit.parse('now').to_t
=> 2025-06-28 22:52:41 -0700
> Fugit.parse('now').to_s
=> "2025-06-28 22:52:45 -0700"Expected behaviour
I would expect the initial Fugit.parse('now') command outputs (before setting ENV['TZ']) to match the EtOrbi.now outputs.
Context
> EtOrbi.platform_info
=> "(etz:\"America/Los_Angeles\",tnz:\"PDT\",tziv:\"2.0.6\",tzidv:nil,rv:\"3.2.8\",rp:\"aarch64-linux\",
win:false,rorv:\"7.2.2.1\",astz:[ActiveSupport::TimeZone, \"America/Los_Angeles\"],
eov:\"1.2.11\",eotnz:#<TZInfo::DataTimezone: America/Los_Angeles>,
eotnfz:\"-0700\",eotlzn:\"America/Los_Angeles\",eotnfZ:\"PDT\",debian:\"America/Los_Angeles\",
centos:nil,osx:\"Etc/UTC\")"```Metadata
Metadata
Assignees
Labels
No labels