]> sipb.mit.edu Git - ikiwiki.git/commitdiff
comments: Store dates in GMT and in ISO-8601
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Fri, 12 Dec 2008 11:02:41 +0000 (11:02 +0000)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Fri, 12 Dec 2008 11:02:41 +0000 (11:02 +0000)
The [[!_comment]] directive is a serialization format, not something for
presentation to users, so we should use the least ambiguous possible
representation.

IkiWiki/Plugin/comments.pm

index 9ea4a3f69878c3fcb8d9a1b5df43104a23dcdcf5..4ed696026c009f80db4857ee9b7829fa02afda21 100644 (file)
@@ -9,6 +9,7 @@ use warnings;
 use strict;
 use IkiWiki 2.00;
 use Encode;
+use POSIX qw(strftime);
 
 use constant PREVIEW => "Preview";
 use constant POST_COMMENT => "Post comment";
@@ -437,7 +438,7 @@ sub sessioncgi ($$) { #{{{
                $content .= " subject=\"$subject\"\n";
        }
 
-       $content .= " date=\"" . IkiWiki::formattime(time, '%X %x') . "\"\n";
+       $content .= " date=\"" . decode_utf8(strftime('%Y-%m-%dT%H:%M:%SZ', gmtime)) . "\"\n";
 
        $content .= " content=\"\"\"\n$editcontent\n\"\"\"]]\n";