From ccf42f2b2a7acf12eab443f5a5d1b74f66211944 Mon Sep 17 00:00:00 2001 From: jengo Date: Sun, 5 Aug 2001 08:04:10 +0000 Subject: [PATCH] Fixed timestamp converstion not working --- phpgwapi/inc/class.db_mysql.inc.php | 4 ++-- phpgwapi/inc/class.db_pgsql.inc.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.db_mysql.inc.php b/phpgwapi/inc/class.db_mysql.inc.php index fe872e6fba..17d32c30ab 100644 --- a/phpgwapi/inc/class.db_mysql.inc.php +++ b/phpgwapi/inc/class.db_mysql.inc.php @@ -127,12 +127,12 @@ function to_timestamp($epoch) { - return date('YmdHis',$epoch); + return date('Y-m-d H:i:s',$epoch); } function from_timestamp($timestamp) { - ereg('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})',$timestamp,$parts); + ereg('([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})',$timestamp,$parts); return mktime($parts[4],$parts[5],$parts[6],$parts[2],$parts[3],$parts[1]); } diff --git a/phpgwapi/inc/class.db_pgsql.inc.php b/phpgwapi/inc/class.db_pgsql.inc.php index 00adea00eb..72820a85fc 100644 --- a/phpgwapi/inc/class.db_pgsql.inc.php +++ b/phpgwapi/inc/class.db_pgsql.inc.php @@ -106,11 +106,11 @@ { if (floor($this->db_version) == 6) { - return $this->from_timestamp_6($epoch); + return $this->from_timestamp_6($timestamp); } else { - return $this->from_timestamp_7($epoch); + return $this->from_timestamp_7($timestamp); } }