Skip to content
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

Use zone.tab instead of files directly in /usr/share/zoneinfo #22

Closed
Tagar opened this issue Apr 12, 2016 · 11 comments
Closed

Use zone.tab instead of files directly in /usr/share/zoneinfo #22

Tagar opened this issue Apr 12, 2016 · 11 comments

Comments

@Tagar
Copy link

Tagar commented Apr 12, 2016

As per
http://unix.stackexchange.com/questions/35781/why-is-zone-tab-missing-so-many-time-zones
and
http://postgresql.nabble.com/A-renewed-plea-for-inclusion-of-zone-tab-td2005687.html
and
https://issues.cloudera.org/browse/IMPALA-3316
often there are subset of files in /usr/share/zoneinfo,
while /usr/share/zoneinfo/zone.tab always has complete information.

It would be more reliable to use Use zone.tab instead of files directly in /usr/share/zoneinfo/zone.tab instead of individual files?

@devbww
Copy link
Collaborator

devbww commented Apr 12, 2016

CCTZ does not control what is in /usr/share/zoneinfo. If that doesn't contain all the zones on your system, raise the issue with your vendor. Or, get the IANA data and install them yourself.

zone.tab is only part of a suggested mechanism for choosing a timezone name based on country and geo position. In the IANA distribution the timezones named in zone.tab all correspond to actual zoneinfo files.

You must choose a timezone name before asking CCTZ to load it. CCTZ only deals with actual zoneinfo files.

@devbww devbww closed this as completed Apr 12, 2016
@Tagar
Copy link
Author

Tagar commented Apr 12, 2016

Thank you for prompt response Bradley.

As discussed on https://issues.cloudera.org/browse/IMPALA-3316?focusedCommentId=206859&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-206859

even PST is missing on RHEL 6.. any more user-friendly workarounds? :-)

@devbww
Copy link
Collaborator

devbww commented Apr 12, 2016

"PST" is not a timezone. It is an abbreviation used by the "America/Los_Angeles" timezone during certain times of the year. It might also be an abbreviation used by some other random timezone.

@Tagar
Copy link
Author

Tagar commented Apr 12, 2016

Yes, I understand..

At the same time there are timezone files for MST and EST in /usr/share/zoneinfo
but not for CST and PST :-)

$ ll | egrep "[PMCE][SD]T"
-rw-r--r-- 1 root root 2294 Oct 1 2015 CST6CDT
-rw-r--r-- 1 root root 118 Oct 1 2015 EST
-rw-r--r-- 1 root root 2294 Oct 1 2015 EST5EDT
-rw-r--r-- 1 root root 118 Oct 1 2015 MST
-rw-r--r-- 1 root root 2294 Oct 1 2015 MST7MDT
-rw-r--r-- 1 root root 2294 Oct 1 2015 PST8PDT
$ pwd
/usr/share/zoneinfo

Thanks.

@devbww
Copy link
Collaborator

devbww commented Apr 12, 2016

The other "timezone names" you call out (CST6CDT, EST, EST5EDT, MST, MST7MDT, and PST8PDT) are special cases in the zoneinfo source to deal with some historical decisions. I suggest avoiding them.

@devbww
Copy link
Collaborator

devbww commented Apr 12, 2016

You won't find them in the zone*.tab files, for example.

@Tagar
Copy link
Author

Tagar commented Apr 12, 2016

You nailed it right there. Yep, they are missing in zone.tab too. I am puzzled how and when on Linux those files like PST are genenerated in /usr/share/zoneinfo ?

@devbww
Copy link
Collaborator

devbww commented Apr 12, 2016

Assuming you meant "PST8PDT" (remember, "PST" is not there), take a look at the "northamerica" file in the IANA distribution under the comment ...

We generate the files specified below to guard against old files with
obsolete information being left in the time zone binary directory.

At some point the compiled zoneinfo files included one named "PST8PDT" (for whatever reason) but whose contents would now be wrong. To guard against a failure to remove that file, the distribution includes a replacement with modern data (although it might not be what you expect---PST8PDT != America/Los_Angeles for some pre-1970 times, for example).

The fear that these files wouldn't be removed is probably obsolete, and I think we'd all be better off if they were excluded from the IANA distribution. In the meantime I can only recommend ignoring them.

@Tagar
Copy link
Author

Tagar commented Apr 12, 2016

Got it. Thanks a lot for the detailed explanation.

@devbww
Copy link
Collaborator

devbww commented Apr 12, 2016

You're welcome. I hope CCTZ is useful to you. We just released "v2" a few days ago, which includes a "civil-time" component. Take another look when you get a chance.

@Tagar
Copy link
Author

Tagar commented Apr 12, 2016

Yep. It's a great library. It makes a lot of sense for heavy-threaded Impala to use cctz as there are performance penalties when using glibc functions, e.g. https://issues.cloudera.org/browse/IMPALA-3316
Looks like performance is one of the focus for cctz library. Casey Ching from Cloudera was very postivive about CCTZ on that jira. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants