Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: What Time is It?

by seattlejohn (Deacon)
on Jan 05, 2004 at 02:29 UTC ( [id://318745]=note: print w/replies, xml ) Need Help??


in reply to What Time is It?

I believe your setting TZ=MST provides insufficient information for the localtime function to determine the correct time zone offset. My understanding is that the TZ setting must include the hours offset from UTC, and that the alphabetic designation you give it is merely for human convenience. So in your case, it would be TZ=MST7 or, perhaps, TZ=MST7MDT to account for the switch to daylight savings time.

Update: sporty's right -- I determined this only for Windows. My Linux box did just fine without the numeric offset. (Thanks for the info on /usr/share/zoneinfo.)

        $perlmonks{seattlejohn} = 'John Clyman';

Replies are listed 'Best First'.
Re: Re: What Time is It?
by exussum0 (Vicar) on Jan 05, 2004 at 02:38 UTC
    It depends on the system. I'm gonna guess you are talking about windows only, but in case you aren't..
    Mon Jan 5 02:35:37 2004[calligraphy:~] sporty% setenv TZ CET [calligraphy:~] sporty% perl -e 'print scalar localtime' Mon Jan 5 03:35:46 2004[calligraphy:~] sporty% setenv TZ MST [calligraphy:~] sporty% perl -e 'print scalar localtime' Sun Jan 4 19:35:51 2004[calligraphy:~] sporty%
    It's because of what's in my /usr/share/zoneinfo/ dir .. so if I created a new one, I could use that, without the number.

    Play that funky music white boy..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://318745]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-28 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found