Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
    print "Localtime is [".localtime($time)."[ when \$ENV{TZ} is [$ENV{TZ}
    +] based on time [$time]\n";
    $ENV{TZ} = 'GMT';
    print "Localtime is now [".localtime($time)."] when \$ENV{TZ} is [$ENV
    +{TZ}[ based on time [$time]\n";
    
  2. or download this
    Localtime is [Wed May 29 14:42:15 2002] when $ENV{TZ} is [] based on t
    +ime [1022704935]
    Localtime is now [Wed May 29 20:42:15 2002] when $ENV{TZ} is [GMT] bas
    +ed on time [1022704935]
    
  3. or download this
    #!/usr/bin/perl
    use strict;
    use Date::Manip;
    print &UnixDate(&ParseDate("epoch ".time()),"%Y-%m-%d %H:%M:%S")."\n";
    
  4. or download this
    [starky@freak bin]$ unset TZ
    [starky@freak bin]$ ./dm-test.pl 
    ...
    [starky@freak bin]$ export TZ=GMT
    [starky@freak bin]$ ./dm-test.pl 
    2002-05-29 21:11:15