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?
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.
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.