I am trying to print a date (taking the date from a mysql table which is stored in 2000-12-02) to 02-Dec-2000 using this code:
my ($year, $mon, $day) = split (/-/, $rec{'date_listed'});
my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
$rec{'date_listed'} = "$day-$months[$mon]-$year";
The problem I am having is that 2000-11-25 shows as 25-Dec-2000 and 2000-12-02 shows as 02--2000 anyone have any ideas what I've done wrong?
my ($year, $mon, $day) = split (/-/, $rec{'date_listed'});
my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
$rec{'date_listed'} = "$day-$months[$mon]-$year";
The problem I am having is that 2000-11-25 shows as 25-Dec-2000 and 2000-12-02 shows as 02--2000 anyone have any ideas what I've done wrong?