Tony Blah
02-23-2003, 06:49 PM
I'm try to edit the date format on the CGI Factory Message Board (http://www.cgi-factory.com/messageboard/index.shtml)
I'd like to change the date format from;
1/2/2003 18:38
to this:
01/02/2003 18:38
The code I think that needs changing in the 'View.pl' file is;
#time
chomp(@data[2]);
($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(@data[2]))[0,1,2,3,4,5,6];
$sec = sprintf("%.02d",$sec);
$min = sprintf("%.02d",$min);
$hour = sprintf("%.02d",$hour);
$mday = sprintf("%.02d",$mday);
$year += 1900;
#date format
if ($date_format==1) {
$date = "$days[$wday], $months[$mon] $mday, $year at $hour:$min";
}
elsif ($date_format==2) {
$mon++;
$date = "$mday/$mon/$year $hour:$min";
}
else {
$mon++;
$date = "$mon/$mday/$year $hour:$min";
}
#
Anybody got an idea how I can do this?
.....thx
I'd like to change the date format from;
1/2/2003 18:38
to this:
01/02/2003 18:38
The code I think that needs changing in the 'View.pl' file is;
#time
chomp(@data[2]);
($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(@data[2]))[0,1,2,3,4,5,6];
$sec = sprintf("%.02d",$sec);
$min = sprintf("%.02d",$min);
$hour = sprintf("%.02d",$hour);
$mday = sprintf("%.02d",$mday);
$year += 1900;
#date format
if ($date_format==1) {
$date = "$days[$wday], $months[$mon] $mday, $year at $hour:$min";
}
elsif ($date_format==2) {
$mon++;
$date = "$mday/$mon/$year $hour:$min";
}
else {
$mon++;
$date = "$mon/$mday/$year $hour:$min";
}
#
Anybody got an idea how I can do this?
.....thx