Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
UNIX time is not shown correctly #91
However, the result of the folloing code seems incorrect.
#!/usr/bin/ruby require 'tzinfo' jst = TZInfo::Timezone.get("Japan") utc = TZInfo::Timezone.get("UTC") time = Time.now.utc puts jst.strftime("%F %T (%Z): %s", time) puts utc.strftime("%F %T (%Z): %s", time)
The code returned:
In the case above, I expecet the result as:
I used tzinfo-1.2.3 with Ruby 2.3.
added a commit
Aug 30, 2018
Thanks for the report.
This is already resolved in the upcoming version 2.0.0 release (currently on the master branch).
For earlier versions of TZInfo, this is a consequence of returning UTC instances of Time and DateTime to represent local times in order to support Ruby versions older than 1.9.3 (that can only handle times in the local system time zone and UTC).
I've committed a change to the 1.2 branch to make