#! /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) ; #### input time is 1160390100 gmtime gives: Mon Oct 9 10:35:00 2006 diff is: 3600