Do you mean unixtime or timestamp?
You can't simply convert a date to unixtime by changing the format string since it needs to be converted into the seconds that have passed after 1970. This function will do the conversion:
my $year = 2005;
my $month = 9;
my $day = 21;
use Time::Local;
my $time = timelocal(0,0,0,$day,$month,$year);
return $time;
}
You can't simply convert a date to unixtime by changing the format string since it needs to be converted into the seconds that have passed after 1970. This function will do the conversion:
Code:
sub { my $year = 2005;
my $month = 9;
my $day = 21;
use Time::Local;
my $time = timelocal(0,0,0,$day,$month,$year);
return $time;
}