http://qs321.pair.com?node_id=347038


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