changeset 99:cd27fd555272

Use a better date + time format.
author Steve Kemp <steve@steve.org.uk>
date Wed, 12 Dec 2007 17:33:22 +0000
parents 3d8b0e615bf3
children 19148729b491
files cgi-bin/comments.cgi
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/cgi-bin/comments.cgi	Wed Dec 12 17:28:29 2007 +0000
+++ b/cgi-bin/comments.cgi	Wed Dec 12 17:33:22 2007 +0000
@@ -14,7 +14,11 @@
 
 use strict;
 use warnings;
+
 use CGI;
+use POSIX qw(strftime);
+
+
 
 #
 #  The directory to store comments in
@@ -59,13 +63,12 @@
 #
 # get the current time
 #
-my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
-  localtime(time);
+my $timestr = strftime "%e-%B-%Y-%H:%M:%S", gmtime;
 
 #
 #  Open the file.
 #
-my $file = $COMMENT . "/" . $id . "." . "$mday-$mon-$year-$hour-$min-$sec";
+my $file = $COMMENT . "/" . $id . "." . $timestr;
 open( FILE, ">", $file );
 print FILE "Name: $name\n";
 print FILE "Mail: $mail\n";