ISO 8601 timestamps can have decimal seconds
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 31 Oct 2008 15:53:15 +0000 (15:53 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 31 Oct 2008 15:53:15 +0000 (15:53 +0000)
includes/GlobalFunctions.php

index b61368a..ead550f 100644 (file)
@@ -1713,7 +1713,7 @@ function wfTimestamp($outputtype=TS_UNIX,$ts=0) {
                # TS_ORACLE
                $uts = strtotime(preg_replace('/(\d\d)\.(\d\d)\.(\d\d)(\.(\d+))?/', "$1:$2:$3",
                                str_replace("+00:00", "UTC", $ts)));
-       } elseif (preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/', $ts, $da)) {
+       } elseif (preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.*\d*)?Z$/', $ts, $da)) {
                # TS_ISO_8601
        } elseif (preg_match('/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)\.*\d*[\+\- ](\d\d)$/',$ts,$da)) {
                # TS_POSTGRES