From 3f1dc32b1010be7c07e2d72249ae9a4748b0750f Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Fri, 17 Nov 2006 20:52:00 +0000 Subject: [PATCH] Fix (possibly temporary) for Postgres timestamp parsing issue. --- includes/GlobalFunctions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 38d89fd658..d6ee0d7846 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1317,6 +1317,10 @@ function wfTimestamp($outputtype=TS_UNIX,$ts=0) { # TS_POSTGRES $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6], (int)$da[2],(int)$da[3],(int)$da[1]); + } elseif (preg_match("/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/",$ts,$da)) { + # TS_POSTGRES + $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6], + (int)$da[2],(int)$da[3],(int)$da[1]); } else { # Bogus value; fall back to the epoch... wfDebug("wfTimestamp() fed bogus time value: $outputtype; $ts\n"); -- 2.20.1