use strict; use warnings; use DateTime::Format::Strptime; my $str = '2007/07/17 13:21'; my $parser = DateTime::Format::Strptime->new( pattern => '%Y/%m/%d %H:%M' ); my $dt = $parser->parse_datetime( $str ); print $dt->epoch; __END__ C:\src\perl\perlmonks\627080>perl -w 627080.pl 1184678460
In reply to Re: Turn date string into timestamp?
by andreas1234567
in thread Turn date string into timestamp?
by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |