Perl extension to parse and format Date string of JavaScript