Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: perl 5.8 shows wrong timestamp on cygwin

by xorl (Deacon)
on Apr 21, 2004 at 15:53 UTC ( #347038=note: print w/replies, xml ) Need Help??


in reply to perl 5.8 shows wrong timestamp on cygwin

I think the problem is that under cygwin localtime returns GMTime.

There's a solution here:

http://www.mail-archive.com/cygwin@cygwin.com/msg37313.html

which says "use POSIX 'tzset'; tzset()" before calling localtime.

I haven't tested it. So use at your own risk.

-XorL

Update: just fixed a typo.

  • Comment on Re: perl 5.8 shows wrong timestamp on cygwin

Replies are listed 'Best First'.
Re: Re: perl 5.8 shows wrong timestamp on cygwin
by tos (Deacon) on Apr 21, 2004 at 18:25 UTC
    Don't be too self-critical xorl. You aren't (imho) an I. ;)

    Thanks for your hint. Regards, tos

    p.s.: no risk, but fun ...

    works fine

    # date Thu Apr 22 07:38:57 2004 # perl -we 'use POSIX "tzset";tzset();use Time::localtime;print ctime( +)' Thu Apr 22 07:38:59 2004

    Is simplicity best or simply the easiest Martin L. Gore

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2021-12-08 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (34 votes). Check out past polls.

    Notices?