July 5th 2004 or
7th May 2004 or
2007 May 04?
All of those are valid interpretations.
.
I would stick with the universally recognised ISO 8601 / RFC 3339 format; where today is 2004-08-29 for example.
See: [w3.org...]
$user_input = "2004-08-28"; @month = ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); $year = substr($user_input,0,4);
$month = substr($user_input,5,2);
$month =~ s/^0//;
$day = substr($user_input,8,2); $your_output = "$months[$month-1] $day, $year";
#!/usr/bin/perl
#date.cgi - converts a numeric date to a string
use CGI qw(:standard);
use strict;
#declare variables
my ($date);
#assign input item to variable
$date = param('Date');
#break date apart
#display date
print "Date: ";