Postgres timestamps can have decimals.
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Sat, 25 Oct 2008 20:35:14 +0000 (20:35 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Sat, 25 Oct 2008 20:35:14 +0000 (20:35 +0000)
includes/GlobalFunctions.php

index 6a5d1c5..b61368a 100644 (file)
@@ -1715,9 +1715,9 @@ function wfTimestamp($outputtype=TS_UNIX,$ts=0) {
                                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)) {
                # TS_ISO_8601
-       } elseif (preg_match('/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)[\+\- ](\d\d)$/',$ts,$da)) {
+       } elseif (preg_match('/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)\.*\d*[\+\- ](\d\d)$/',$ts,$da)) {
                # TS_POSTGRES
-       } elseif (preg_match('/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/',$ts,$da)) {
+       } elseif (preg_match('/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)\.*\d* GMT$/',$ts,$da)) {
                # TS_POSTGRES
        } else {
                # Bogus value; fall back to the epoch...