From fd540bad79750b20da7db7680f504ef1dc860b38 Mon Sep 17 00:00:00 2001 From: thomascube Date: Mon, 9 May 2011 21:20:08 +0000 Subject: Rely on mysql server timezone not on PHP --- program/include/rcube_mdb2.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'program') diff --git a/program/include/rcube_mdb2.php b/program/include/rcube_mdb2.php index b25938bf8..365832806 100644 --- a/program/include/rcube_mdb2.php +++ b/program/include/rcube_mdb2.php @@ -574,7 +574,12 @@ class rcube_mdb2 */ function fromunixtime($timestamp) { - return date("'Y-m-d H:i:s'", $timestamp); + switch ($this->db_provider) { + case 'mysql': + return 'FROM_UNIXTIME(' . intval($timestamp) . ')'; + default: + return date("'Y-m-d H:i:s'", $timestamp); + } } -- cgit v1.2.3