jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
Output#! /usr/bin/perl -l use strict ; use warnings ; use POSIX 'strftime'; my $a = time() ; # local time is now 12:35:00 print "input time is $a" ; print "gmtime gives: ".gmtime($a) ; my $b = strftime("%s", gmtime(int $a)) ; # %s converts date to epoch print "diff is: ".($a - $b) ;
So, the 3600 is my problem, it should have been zero (I think)....input time is 1160390100 gmtime gives: Mon Oct 9 10:35:00 2006 diff is: 3600
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: working with epoch seconds
by McDarren (Abbot) on Oct 09, 2006 at 11:03 UTC | |
by jeanluca (Deacon) on Oct 09, 2006 at 11:30 UTC | |
by Hue-Bond (Priest) on Oct 09, 2006 at 11:47 UTC | |
by jeanluca (Deacon) on Oct 09, 2006 at 12:34 UTC | |
by Hue-Bond (Priest) on Oct 09, 2006 at 12:58 UTC | |
|
Re: working with epoch seconds
by ysth (Canon) on Oct 10, 2006 at 02:27 UTC |