#!/usr/bin/env perl -l use strict; use warnings; use Time::Local; my $iso_date = '1970-01-01T01:01:01'; my $expected_epoch = 1 * 60 * 60 + 1 * 60 + 1; my ($date, $time) = split /T/ => $iso_date; my ($year, $mon, $mday) = split /-/ => $date; $year -= 1900; $mon -= 1; my ($hour, $min, $sec) = split /:/ => $time; print "Expected Epoch: $expected_epoch"; print 'Calculated Epoch: ', timegm($sec, $min, $hour, $mday, $mon, $year);