in reply to Converting date and time into seconds
Update: This post went through a series of rapid updates (code example, warning on using split in addition to regex, disclosure of ignorance with Time::localtime, and this update itself. Blame it on being Monday morning.# untested sub stamp2epoch { my $stamp = shift @_; my ($yr, $mon, $day, $hr, $min, $sec) = split /[ :-]+/, $stamp; --$mon; return timelocal($sec, $min, $hr, $day, $mon, $yr); }
Cheers - L~R
|
|---|