If you need to convert Date from YYYY-MM-DD format to MM/DD/YYYY format, use below perl code.
$str="2008-10-13";
$str =~s/^(\d{4})\-(\d{2})\-(\d{2})/$2\/$3\/$1/;
print $str;
will output:
10/13/2008
Monday, October 13, 2008
Perl: Date formatting
Posted by Vishnu Agrawal at 9:08 PM
Labels: perl script
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment