Timezone is not correct #55

Closed
rotem443 opened this Issue Sep 5, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@rotem443

rotem443 commented Sep 5, 2016

I'm trying to get the offset from the UTC time at Israel timezone:

TZInfo::Timezone.get('Israel').current_period.utc_offset / (60*60)

The result is 2 hours when 3 hours is expected (http://www.timeanddate.com/time/zone/israel/jerusalem)

@philr

This comment has been minimized.

Show comment
Hide comment
@philr

philr Sep 5, 2016

Member

utc_offset gives the base offset of the time zone (not taking daylight savings time into account). For the total offset including daylight savings time, use utc_total_offset instead:

TZInfo::Timezone.get('Israel').current_period.utc_total_offset / (60*60)
Member

philr commented Sep 5, 2016

utc_offset gives the base offset of the time zone (not taking daylight savings time into account). For the total offset including daylight savings time, use utc_total_offset instead:

TZInfo::Timezone.get('Israel').current_period.utc_total_offset / (60*60)

@philr philr added the question label Sep 5, 2016

@philr philr closed this Sep 5, 2016

philr added a commit that referenced this issue Jun 7, 2018

Rename #utc_offset and #utc_total_offset.
The #utc_offset and #utc_total_offset attributes are often confused
(#55, #89). Rename as #base_utc_offset and #current_utc_offset
respectively.

Retain the old names as aliases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment