in reply to Re: Not able to ParseDate lines from a file
in thread Not able to ParseDate lines from a file

DateTime::Format::Natural can parse the string for you. You don't have to reinvent the wheel. Try this:
#!/usr/bin/perl -l use strict; use warnings; use DateTime; use DateTime::Format::Natural; my $parser = DateTime::Format::Natural->new; my $extract_string = "Date: 02.07.2011 16:14:48"; my $date_string = $parser->extract_datetime($extract_string); my $dt = $parser->parse_datetime($date_string); my $epoch_time = $dt->epoch; print $epoch_time;