#! /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) ;