I use DateTime::Format::DateManip for things like this. Using your dates....
use DateTime::Format::DateManip;
my @dates = (
'11/17/2008',
'11/17/2008 3pm',
'11/17/2008 12:01am',
'11/17/2008 12:01am EST',
'11/17/2008 12:01am CST',
);
for my $date ( @dates ) {
my $dt = DateTime::Format::DateManip->parse_datetime( $date );
die "Cannot parse date $date" unless defined $dt;
say $dt;
}
# no dies.. produced the following....
# => 2008-11-17T00:00:00
# => 2008-11-17T15:00:00
# => 2008-11-17T00:01:00
# => 2008-11-17T05:01:00
# => 2008-11-17T06:01:00
NB. I'm on GMT here!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…