Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

looking for ideas on how to deal with multiple timezones

2 views
Skip to first unread message

Larry W. Virden

unread,
Feb 8, 2007, 9:39:54 AM2/8/07
to
I have a need to display :

hh:mm YYYY-MM-DD location timezone daylight_savings_indicator

for a couple of dozen locations.

The wiki (http://wiki.tcl.tk/clock) says I should use:

set now [clock seconds]
set locale "C"
set tz "EST"
set location "OHIO"
set daylight "how do I get this info?"
clock format $now -format " %H:%M %G-%m-%d $location $tz $daylight" -
locale $locale -timezone $tz

However, I have a few problems.

1. I don't know how to determine the locale for each of the locations
I have - I have 15 or so locations around the world.
2. I don't know how to programatically determine whether the date I
will have (I won't be using clock seconds, but scanning a date and
time provided by the user) occurs during daylight savings time.
3. When I run the above commands, I get the error:
time zone EST not found

Does anyone have some pointers to more information for doing this sort
of thing?

Donal K. Fellows

unread,
Feb 8, 2007, 5:21:26 PM2/8/07
to
Larry W. Virden wrote:
> 1. I don't know how to determine the locale for each of the locations
> I have - I have 15 or so locations around the world.

Hmm, maybe an atlas? Google? :-)

> 2. I don't know how to programatically determine whether the date I
> will have (I won't be using clock seconds, but scanning a date and
> time provided by the user) occurs during daylight savings time.

Get the timezone right (e.g. :US/Eastern) and you don't need to
determine. The guts of [clock] knows the DST rules better than I do.

> 3. When I run the above commands, I get the error:
> time zone EST not found

Works for me with that one when in upper-case, but not in lower case
or for all the ones listed on the clock manual page?! You need the
clock-master for that one...

Donal.

Larry W. Virden

unread,
Feb 9, 2007, 7:55:08 AM2/9/07
to
On Feb 8, 5:21 pm, "Donal K. Fellows" <donal.k.fell...@man.ac.uk>
wrote:

> Larry W. Virden wrote:
> > 1. I don't know how to determine the locale for each of the locations
> > I have - I have 15 or so locations around the world.
>
> Hmm, maybe an atlas? Google? :-)

I've never seen an atlas that listed the C language locale for a
country. And googling for "locale israel" for instance, results in a
million plus hits on things like "this book has a locale of Israel" -
not really relevant.


>
> > 2. I don't know how to programatically determine whether the date I
> > will have (I won't be using clock seconds, but scanning a date and
> > time provided by the user) occurs during daylight savings time.
>
> Get the timezone right (e.g. :US/Eastern) and you don't need to
> determine. The guts of [clock] knows the DST rules better than I do.

But I do need to know it - the program I need to write displays the
word "daylight" when the date and time is within daylight savings
time.

>
> > 3. When I run the above commands, I get the error:
> > time zone EST not found
>
> Works for me with that one when in upper-case, but not in lower case
> or for all the ones listed on the clock manual page?! You need the
> clock-master for that one...

Weird - why would it fail on a tcl 8.5a6 system for me and work for
you? The only reason I can think of is that something is failing based
on the flags I am using. Looks like it is time to submit a bug report.
Thanks.

0 new messages