in reply to date conversion

Hi ,

One option is to use regex:
my $in_date = '051407'; (my $db_date = $in_date) =~ s/(\d\d)(\d\d)(\d\d)/$1-$2-$3/; print ":$db_date:";

But there is one issue how would you find that date belongs to 20th century or 21st
Example:
The above date could be :05-14-2007 or 05-14-1907

And one advise its always better to search before you post a question.

Replies are listed 'Best First'.
Re^2: date conversion
by zork42 (Monk) on Jul 18, 2013 at 06:53 UTC