New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-02 abbreviation for 'Atlantic/South_Georgia' #82

Closed
curtp opened this Issue Feb 24, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@curtp

curtp commented Feb 24, 2018

Hello,

I think this may be a configuration issue between our development and our production environments, but I'm not able to track it down.

We have a user who selected the 'Atlantic/South_Georgia' timezone. When the time zone is displayed, it is showing -02 for the abbreviation instead of GST which is what I'm getting in my development environment.

Here is the output from both environments showing the difference.

Local:
tz = TZInfo::Timezone.get('Atlantic/South_Georgia')
=> #<TZInfo::DataTimezone: Atlantic/South_Georgia>
tz.current_period
=> #<TZInfo::TimezonePeriod: #<TZInfo::TimezoneTransitionDefinition: #<TZInfo::TimeOrDateTime: -2524512832>,#<TZInfo::TimezoneOffset: -7200,0,GST>>,nil>
tz.current_period.abbreviation
=> :GST

Production:
tz = TZInfo::Timezone.get('Atlantic/South_Georgia')
=> #<TZInfo::DataTimezone: Atlantic/South_Georgia>
tz.current_period
=> #<TZInfo::TimezonePeriod: #<TZInfo::TimezoneTransitionDefinition: #<TZInfo::TimeOrDateTime: -2524512832>,#<TZInfo::TimezoneOffset: -7200,0,-02>>,nil>
tz.current_period.abbreviation
=> :"-02"

Any pointers on where I can look next?

@curtp curtp closed this Feb 24, 2018

@curtp curtp reopened this Feb 24, 2018

@curtp

This comment has been minimized.

curtp commented Feb 24, 2018

Sorry for close/reopen. I think I've tracked it down to a difference between the content of /usr/share/zoneinfo/Atlantic/South_Georgia

Going to look into using the TZInfo::Data source instead of OS

@curtp curtp closed this Feb 24, 2018

@raelgc

This comment has been minimized.

raelgc commented Jul 23, 2018

@curtp I'm facing a similar issue, where the abbreviation for the timezone is returned as integer instead of a string with the correct abbreviation (in my case, I want to see BRT for America/Sao_Paulo but I'm getting only -03).

How you forced to use TZInfo::Data? Just including tzinfo and tzinfo-data gems in bundler?

@curtp

This comment has been minimized.

curtp commented Jul 23, 2018

Unfortunately, we never did get it to work properly. It is still working off of the /usr/share/zoneinfo files and displaying whatever is contained within it.

@raelgc

This comment has been minimized.

raelgc commented Jul 23, 2018

@curtp While searching for similar issues in the past, I just found an explanation on #68: a lot of timezones in the Timezone Database were moved to use numeric representations instead of "invented" abbreviation according them.

While they mentioned South American changes, we can see other timezones in the related commit (including Georgia): eggert/tz@c9e6ef0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment