in reply to Converting dates

There's a standard module (as in "comes with perl"), Time::Local, which provides inverse functions for localtime and gmtime: timelocal() and timegm(). These can convert dates/times in a list format, (ss, mm, hh, dd, MM, yyyy), to an epoch time. As explained in How do I find the difference in days between two dates, in a cool perl way? which was pointed to in another reply, this is a number of seconds since, typically, January 1st 1970, 00:00:00 GMT. That is the case on Unix and Windows, at least.

So first you must get your year/month/day out of the string:

$date = '05-02-2003'; my($d,$m,$y) = $date =~ /(\d+)-(\d+)-(\d+)/;
Subtract 1 from the month, as January is month 0. Seconds since the epoch can be found like this:
use Time::Local; my $time = timegm(0, 0, 0, $d, $m-1, $y);
I use midnight, and GMT, as a reference, with regards to summer time issues — GMT doesn't have them. If you desire finer results, with an exact hours/minutes/seconds count, you can always use timelocal(), and real times.

The calculated value is 1044403200. You can see that it works well, like this:

print scalar gmtime($time);
which produces
Wed Feb 5 00:00:00 2003
OK?