]> sipb.mit.edu Git - ikiwiki.git/commitdiff
edittemplate: use unambiguous RFC 3339 datestamps
authorSimon McVittie <smcv@debian.org>
Tue, 1 Jul 2014 07:52:48 +0000 (08:52 +0100)
committerSimon McVittie <smcv@debian.org>
Mon, 1 Sep 2014 08:01:07 +0000 (09:01 +0100)
These take into account the timezone offset (and convert it to UTC+0000)
rather than being in an unspecified timezone.

IkiWiki/Plugin/edittemplate.pm
doc/ikiwiki/directive/edittemplate.mdwn

index 947c8f215302bdc04b9fbd9b0dbd891740542e14..c2a8da29f853ec5f13e8fab959773751cc86ada9 100644 (file)
@@ -156,7 +156,7 @@ sub filltemplate ($$) {
        }
 
        my $time = time();
-       $template->param(time => IkiWiki::formattime($time, "%Y-%m-%d %H:%M:%S"));
+       $template->param(time => IkiWiki::date_3339($time));
 
        return $template->output;
 }
index 11cc898515db9d2cafbd607adb47c30d9ae0a520..6269f5dd8a23935f1970fe62b998ecc15f569885 100644 (file)
@@ -39,6 +39,8 @@ These variables might be set:
   (Requires the `UUID::Tiny` Perl module if not running on Linux.)
 
 * `<TMPL_VAR time>` is replaced with the current (template generation)
-  time, using a fixed format, `%Y-%m-%d %H:%M:%S`.
+  time using a fixed format (RFC 3339, `%Y-%m-%dT%H:%M:%SZ`),
+  suitable for use in `\[[!meta date="<TMPL_VAR time>"]]`
+  (see [[meta]]) or `\[[!date "<TMPL_VAR time>"]]` (see [[date]]).
 
 [[!meta robots="noindex, follow"]]