diff options
author | thomascube <thomas@roundcube.net> | 2011-05-09 21:20:08 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2011-05-09 21:20:08 +0000 |
commit | fd540bad79750b20da7db7680f504ef1dc860b38 (patch) | |
tree | 269af06c0e4411b4ce825f4b28e604f85a54e596 | |
parent | c739c713513f5ef1aec44249108edf07f588c248 (diff) |
Rely on mysql server timezone not on PHP
-rw-r--r-- | program/include/rcube_mdb2.php | 7 |
1 files changed, 6 insertions, 1 deletions
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); + } } |