I have 2 linux machines that need to run a Perl script and access a database.
The date (as reported by the
date -u commands) is correct (within a couple of minutes), but returning epoch from Perl has a 1 hour difference resulting in having on one machine UTC epoch-timestamp and on the other the wanted CET.
date on A:
Tue Dec 11 13:34:09 CET 2012
date on B:
Tue Dec 11 13:33:20 CET 2012
The script uses Time::HiRes and gathering the localtime->epoch to generate a date. I build a minimalistic following script to output the behaviour:
#/usr/bin/perl # use Time::HiRes qw(time); use Time::Piece; # my $date = Time::Piece->strptime(localtime->epoch,"%s"); print "$date->datetime"."\n"; print $date->tzoffset."\n"; print $date->epoch."\n";
Output Machine A:
Tue Dec 11 12:35:43 2012->datetime 0 1355229343
Output Machine B:
Tue Dec 11 13:34:25 2012->datetime 0 1355232865
So as you see something must be wrong, probably with timezone or something similar. But I don't know where to look and what to configure as
date itself outputs the correct time.