diff options
author | Frank Lichtenheld <djpig> | 2005-05-01 00:25:20 +0000 |
---|---|---|
committer | Frank Lichtenheld <djpig> | 2005-05-01 00:25:20 +0000 |
commit | 4e09ab893d7f58c873d8d6cd9b1f3aced3d1e4c9 (patch) | |
tree | 456dbfca29fa999df066191e9e9a72279bfe1a9b /english/template/debian/ctime.wml | |
parent | 0a6a8c7a70b681753a4fb3509d860210046a1f8e (diff) |
use a fully correct formatted timestamp for the rss feeds
new function rdf_ctime in ctime.wml for that
CVS version numbers
english/security/dsa-long.rdf.in: 1.4 -> 1.5
english/security/dsa.rdf.in: 1.8 -> 1.9
english/template/debian/ctime.wml: 1.112 -> 1.113
Diffstat (limited to 'english/template/debian/ctime.wml')
-rw-r--r-- | english/template/debian/ctime.wml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/english/template/debian/ctime.wml b/english/template/debian/ctime.wml index 22eaaf2ff25..9f649e8aa49 100644 --- a/english/template/debian/ctime.wml +++ b/english/template/debian/ctime.wml @@ -146,6 +146,21 @@ sub webwml_ctime { return eval("sprintf($dateform)"); } +# creates a timestamp in "W3C Date and Time Format" +# see http://www.w3.org/TR/NOTE-datetime +sub rdf_ctime { + $WML_GEN_ISOTIME =~ /(\d+)-(..)-(\d+) (..):(..):(..)/; + if ($1 <= 31) { # for WML 1.x + $time = timelocal($6, $5, $4, $1, $2-1, $3); + } else { # for WML 2.x + $time = timelocal($6, $5, $4, $3, $2-1, $1); + } + my ($sec, $min, $hour, $mday, $monnr, $year, $wday, $yday, $isdst) = gmtime($time); + $year += 1900; + $monnr += 1; + return sprintf( "%04d-%02d-%02dT%02d:%02d:%02d+00:00", $year, $monnr, $mday, $hour, $min, $sec ); +} + # This function creates a terse date string for use in news articles. # Input: A date in ISO format (YYYY-MM-DD). sub newsdate { |