D
daveyand
Hey guys,
I'm wracking my brain trying to get this working but cant seem to
fathom it out.
I have a date like: 03/14/06 and want to get the unixtime from it.
I have tried to use time local like so:
my ($mon, $day, $year) = ($date =~ m!(\d\d)/(\d\d)/(\d\d)!);
my $unixtime = timelocal(0, 0,0, $day, ($mon - 1), ($year - 1900));
And i get the following output:
Setting 03/14/06 to be unixtime
Day too small - -717264 > -24856
Sec too small - -717264 < 74752
Cannot handle date (0, 0, 0, 14, 2, 6) at ./look_for_mod.pl line 156
What am i doing wrong? I cant work it out....
Cheers for any help.
I'm wracking my brain trying to get this working but cant seem to
fathom it out.
I have a date like: 03/14/06 and want to get the unixtime from it.
I have tried to use time local like so:
my ($mon, $day, $year) = ($date =~ m!(\d\d)/(\d\d)/(\d\d)!);
my $unixtime = timelocal(0, 0,0, $day, ($mon - 1), ($year - 1900));
And i get the following output:
Setting 03/14/06 to be unixtime
Day too small - -717264 > -24856
Sec too small - -717264 < 74752
Cannot handle date (0, 0, 0, 14, 2, 6) at ./look_for_mod.pl line 156
What am i doing wrong? I cant work it out....
Cheers for any help.