You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Timezone#strftime("%s", time) converts the given time to UNIX time. Because UNIX time is the number of seconds that have elapsed since 1970-01-01 00:00:00 (UTC), the result does not depends on the timezone.
However, the result of the folloing code seems incorrect.
%s was being deferred to the result of the conversion to local. This is
actually a UTC instance being used to represent local time, so the
result would be the number of seconds since the epoch plus the total UTC
offset.
Override the handling of %s and use the passed in UTC instance to
calculate the value.
Resolves#91.
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 Timezone#strftime return the correct number of seconds since the epoch for the %s directive.
Timezone#strftime("%s", time)
converts the given time to UNIX time. Because UNIX time is the number of seconds that have elapsed since 1970-01-01 00:00:00 (UTC), the result does not depends on the timezone.However, the result of the folloing code seems incorrect.
The code returned:
In the case above, I expecet the result as:
I used tzinfo-1.2.3 with Ruby 2.3.
The text was updated successfully, but these errors were encountered: