in reply to unix timestamp

Why the restriction on modules? Do you mean without using any modules? Because with Time::Local (part of the standard perl distribution since forever) you can do this:

my $date = "2004-06-14 13:34:54"; my ($year,$month,$day,$hour,$minute,$second) = $date =~ /^(\d{4})-(\d\d)-(\d\d)\s+(\d\d):(\d\d):(\d\d)$/ or die; $gmt = timelocal($second,$minute,$hour,$day,$month-1,$year);

Chop up the date string however you please.