#!/usr/bin/perl use strict; use warnings; print < Epoch translator

Epoch - Local time translator/converter

EOF my $lEpochString = substr($ENV{'QUERY_STRING'}, -10); my $lEpoch = 0; if ( $lEpochString =~ m/^\d+$/ ) { $lEpoch = $lEpochString; } else { $lEpoch = time(); } print "

Local time is: " . localtime($lEpoch) . " from epoche: $lEpoch

"; print "

To convert enter URL like this: cgi-bin/test.pl?$lEpoch

"; print < EOF