[tz] User time zones

Steven Abner pheonix at zoomtown.com
Thu Dec 8 01:08:59 UTC 2011


On Dec 7, 2011, at 6:27 PM, Guy Harris wrote:

> End users don't use APIs, they use applications that use APIs.  Programmers use APIs.

Sorry about lose wording. From http://pubs.opengroup.org/onlinepubs/9699919799/ ,
"If %Z is being scanned, then getdate() shall initialize the broken-down time to be the
current time in the scanned timezone."
>From my mail "December 7, 2011 6:27:27 PM EST".
>From same publication, strftime(), conversion specifier Z, "Replaced by the timezone name
or abbreviation, or by no bytes if no timezone information exists."
The publication does not specify %Z for strptime(), however Lunix "%Z The timezone name."
Now strptime() should be able to parse a formatted string, so if strftime() formats a string, it
would be "expected" to handle "Replaced by the timezone name or abbreviation, or by no bytes
if no timezone information exists."
I belong to the Eastern time zone, which can be represented be the abbreviations EST/EDT depending
on the time of year. And a little history, I was shocked when I first used the database and it incorrectly
did my time zone with no dst, I used EST. Of course it worked after remembering that EST5EDT was
the way I use to do it on the old 8086/8088 (could of been the 286?) machines. Then I found certain towns
had different times, and joined different time zones at certain dates, or elected even not to be a part of the
time zone, yet still used the time zones abbreviation. So now after about 30 years ......

>From what you wrote, it looks like something I saw from Perl. There you or even somebody's application
has the option to query further. Then you can accurately pinpoint an actual town or jurisdiction and
use an Olson location. I am not sure of what function Perl would use or your application would use
if you wished to translate a server in Japan sending a date string of "Maintenance will begin at 12:00 JST"
and desired to display it in a local time string. From all my work with the database there is no JST time
zone even though the Olson files of :Japan, :Asia/Tokyo state that those locales use the Japan time zone
which only uses JST abbreviation representation for Japan Standard Time zone with a UTC offset of +9.
How would one even start querying a user. Would you scan all the files? or search the internet of how to
interpret JST? Would you just use each file that started with "J" and ask "do you mean Jakarta Standard Time?"
or open each file looking for an abbreviation? What if your application shouldn't interact to convert to
local time display?

I have no idea how people want to design an application or want to use the database for there gain. I
do know what is well published and what research I have found. Several websites even publish the
abbreviations, some dictionaries have entries. Why shouldn't a function that deals with time not be
allowed to use a time zone as input, when it is well understood what the abbreviation stands for?
And why shouldn't a group of people that deal with time zone information not be the fore runners in
setting up a means of allowing programmers to present this to the public.

I am by no means trying to dictate how a person should use the database nor trying to limit a user's means
of displaying time. I had a problem using the database, found a solution, and opted to share what I discovered.
I had more questions, and this seem to sate my needs. And fortunately I have received a lot of great input
and questions to help me sure up what I need the database for. Hopefully you all might benefit as well?

Sorry if not the best with words,
Steve



More information about the tz mailing list