Help for this page

Select Code to Download


  1. or download this
    use strict; use warnings; # to avoid purgatory
    use HTTP::Date qw(str2time);
    my $timestamp_local="20110905 142631";
    my $seconds_since_epoch=str2time($timestamp_local, 'UTC');
    print "$seconds_since_epoch\n".gmtime($seconds_since_epoch)."\n";
    
  2. or download this
    1315232791
    Mon Sep  5 14:26:31 2011
    
  3. or download this
    my $seconds_since_epoch=str2time($timestamp_local, '+0200');
    
  4. or download this
    use strict; use warnings; # to avoid purgatory
    use HTTP::Date qw(str2time);
    ...
    my $timestamp_local="20110905 142631";
    my $seconds_since_epoch=str2time($timestamp_local, $difference_to_utc)
    +;
    print "$seconds_since_epoch\n".gmtime($seconds_since_epoch)."\n";
    
  5. or download this
    1315225591
    Mon Sep  5 12:26:31 2011