in reply to Re: Difficult on use time
in thread Difficult on use time

Thanks for introducing me the sitecustomize.pl. This is new for me to notice! However, could you explain a little for what purpose of this work is supposed to be done ? Though, still can't do the trick I want. what I would expect is :
$tm = time; @gmt = gmtime ( $tm ) ; @local = localtime ( $tm ); # and @gmt should identical to @local
This could happen if I change my system tz to GMT+0

Replies are listed 'Best First'.
Re^3: Difficult on use time
by ikegami (Patriarch) on Apr 08, 2012 at 21:30 UTC

    They are identical

    $tm=time; print scalar(gmtime($tm)), "\n"; print scalar(localtime($tm)), "\n"; require POSIX; $ENV{TZ} = 'UTC'; POSIX::tzset(); print scalar(gmtime($tm)), "\n"; print scalar(localtime($tm)), "\n";
    Sun Apr 8 21:29:55 2012 Sun Apr 8 17:29:55 2012 Sun Apr 8 21:29:55 2012 Sun Apr 8 21:29:55 2012
      Oops... Sorry that's my fault again... what I think if I am working in GMT+0.. besides the gmt time and localtime goes the same, I would expect the return time is local time based.