>>>>> "Dale" == Dale Pellerin <[EMAIL PROTECTED]> writes:

Dale> How do you convert a date that is already in the format YYYYMMDD into Epoch
Dale> seconds?

Dale> $date = 20011130

Presuming you want midnight localtime for that date:

my $date = "20011130";
my ($year, $month, $day) = $date =~ /(\d\d\d\d)(\d\d)(\d\d)/ or die;
use Time::Local;
my $epoch = timelocal(0, 0, 0, $day, $month-1, $year-1900);
print scalar localtime $epoch;

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to