For Programmers: Free Programming Magazines  


Home > Archive > Tcl > March 2006 > Re: winter and summer time confusion in clock and tcl 8.4.12 and









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: winter and summer time confusion in clock and tcl 8.4.12 and
Michael Schlenker

2006-03-30, 8:02 am

MartinLemburg@UGS wrote:
> Hello,
>
> I just realized, that there is one 1 hour difference between the "old"
> clock from tcl 8.4.12 and the "new" clock from tcl 8.5a4 (starpack).
>
> I only used "clock format [clock scan now]" and the result in tcl
> 8.4.12 was right. The result in tcl 8.5a4 (starpack) is one hour before
> the current time.
>
> I think it could be something about winter and summer time, because
> last wend (26/27.3.2006) we switched one hour forward to the summer
> time.
>
> Should I file a bug?


This seems to be documented in the Tcl 8.5 clock scan manpage:
(near the end of the manpage)

Daylight savings time correction is applied only when the relative time
is specified in units of days or more

As now is a relative time and not in units of days or more, no
correction is done.

Michael
Michael Schlenker

2006-03-30, 7:04 pm

MartinLemburg@UGS wrote:
> Hello Michael,
>
> , that I didn't read the man page good enough.
>
> But reading the man page again, I'm not sure if this problem is about
> daylight savings time.
> I'm not on the boundary of daylight savings time, so I would expect to
> get the right time, not only the right date.
>
> And even if - "now" is now, here in Berlin and not "1 hour to the
> west".
>
> I think such "relative" tokens like now (which is not really relative,
> like e.g. today) must cause "clock scan" to return the real, current
> time with all corrections.
>
> And ... by the way:
>
> % clock format [clock seconds]
> Thu Mar 30 13:59:02 +0100 2006
> % clock format [clock scan now]
> Thu Mar 30 14:00:02 +0100 2006
>
> But it is one hour later! It does not seem to matter, if "clock scan
> now" or "clock seconds" is used!


+0100 is the timezone specifier... +1 Hour against UTC in your case,
which is winter time..., so no daylight saving time included.

It works fine on my linux box... (SUSE 9.3)
schlenk@vacca:~> tclsh8.5
% clock format [clock seconds]
Thu Mar 30 16:10:05 CEST 2006
% clock format [clock scan now]
Thu Mar 30 16:10:17 CEST 2006

Not sure whats going on there..., sorry for the confusion.


Michael

Ralf Fassel

2006-03-30, 7:04 pm

* "MartinLemburg@UGS" <martin.lemburg.ugs@gmx.net>
| % clock format [clock seconds]
| Thu Mar 30 13:59:02 +0100 2006
| % clock format [clock scan now]
| Thu Mar 30 14:00:02 +0100 2006
|
| But it is one hour later! It does not seem to matter, if "clock scan
| now" or "clock seconds" is used!

- is TZ set on the commandline prior to invoking tclsh? Does
'date' report the correct date on the commandline?

On my system (Suse Linux 9.3), this currently is
% date -R
Thu, 30 Mar 2006 16:47:51 +0200
Note the +0200.

- is TZ set: $env(TZ) *in* tclsh?

As Michael pointed out, the +0100 looks like tclsh gets the wrong idea
of the timezone you're in.

R'
Bryan Oakley

2006-03-30, 7:04 pm

Are you in Australia? I vaguely recall reading that this year Australia
(or part of Australia?) is switching daylight savings time a w
earlier or later than expected and is causing problems on MS machines.

Searching google on "Australia daylight savings 2006" yields a MS
knowledge base article on the issue.

http://www.microsoft.com/downloads/...&displaylang=en

A relevant quote:

"The Commonwealth Games are scheduled to be held during March 2006 in
Melbourne Australia. Several Australian states including New South
Wales, Victoria, Australian Capital Territory, South Australia and
Tasmania, have changed the Daylight Savings transition end dates to the
first Sunday of Apr 2006."
Michael Schlenker

2006-03-30, 7:04 pm

MartinLemburg@UGS schrieb:
> Hi Ralf,
>
> to your questions:
>
> | - is TZ set on the commandline prior to invoking tclsh? Does
> | 'date' report the correct date on the commandline?
>
> I'm on MS Windows XP SP2 and the environment variable TZ is not set.
> The MS date and time commands of the command shell show the correct
> date and time.
>
> | - is TZ set: $env(TZ) *in* tclsh?
>
> No - inside the starpack the variable env(TZ) is not set.
>
> Can I help with more information?
>
> Best regards,
>
> Martin Lemburg
> UGS - Transforming the Process of Innovation
>

Just tested your example on windows with the latest 8.5a4 RC..., and it
does show the correct time.

Could it be that the starkit you use does not have a copy of the
timezone files which are part of 8.5, to save on the size of the tclkit?

When i rename the folder tzdata in my tcl/lib dir and retest your code,
it returns results that are similiar to yours, so you may simply be
missing the olson based tzdata files (which are not needed on all
platforms).

Michael

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com