#1915 clock format gets wrong timezone, once

obsolete: 8.4a4
closed-works-for-me
5
2003-07-31
2002-06-27
No

Tcl Versions 8.3.4 and 8.4a4.
Platform DEC Alpha OSF1 v4.0
DEC C V5.8-009 on Digital UNIX V4.0

==== clock-3.2 clock format tests FAILED
==== Contents of test case:

# TCL_USE_TIMEZONE_VAR

catch {set oldtz $env(TZ)}
set env(TZ) PST
set x {}
append x [clock format 863800000 -format %Z -gmt 1]
append x [set env(TZ)]
catch {unset env(TZ); set env(TZ) $oldtz}
set x

---- Result was:
CSTPST
---- Result should have been:
GMTPST
==== clock-3.2 FAILED

On closer inspection, it appears that [clock format]
returns the wrong timezone only one time after changing
the env(TZ) variable. Subsequent calls to [clock format]
return the proper timezone. for example:

./tclsh
% set env(TZ)
% clock format 863800000 -format %Z -gmt 1
GMT
% set env(TZ) PST
PST
% clock format 863800000 -format %Z -gmt 1
CST
% clock format 863800000 -format %Z -gmt 1
GMT
% clock format 863800000 -format %Z -gmt 1
GMT
%

It doesn't seem to matter if env(TZ) is set prior to
entering tclsh. This problem also does not appear on
HP-UX or Win32. Maybe it is a 64 bit thing.

Discussion

  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Reinhard was doing something in this are recently. (Can't
    reproduce on Solaris/SPARC)

     
  • Donal K. Fellows

    • assigned_to: dkf --> rmax
     
  • Donal K. Fellows

    • labels: 105657 --> 06. Time Measurement
     
  • Reinhard Max

    Reinhard Max - 2002-06-29

    Logged In: YES
    user_id=124643

    My changes only affect locales, not timezones, and I only
    changed 8.4, not 8.3. It also doesn't happen on any of the
    many 32 and 64 bit platforms I have at hand.
    Maybe the systenm's strftime() function is to blame.

     
  • Bob Techentin

    Bob Techentin - 2002-07-02

    Logged In: YES
    user_id=43494

    Well, if I've got the only hardware on the planet that is
    affected, then it may be difficult to figure out. Our somewhat
    crusty alpha doesn't have a functioning debugger, so I can't
    supply any insights at this time.

     
  • Reinhard Max

    Reinhard Max - 2003-07-31

    Logged In: YES
    user_id=124643

    Any news on this one?
    Otherwise I suggest to close it.

     
  • Bob Techentin

    Bob Techentin - 2003-07-31

    Logged In: YES
    user_id=43494

    Closing this report is fine with me. I haven't heard anyone
    else complain about clock-3.2 failing. Our old alpha box isn't
    online any more, so I can't even reproduce the problem.

     
  • Reinhard Max

    Reinhard Max - 2003-07-31
    • status: open --> closed-works-for-me
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks