From fd540bad79750b20da7db7680f504ef1dc860b38 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 09 May 2011 17:20:08 -0400
Subject: [PATCH] Rely on mysql server timezone not on PHP

---
 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 b25938b..3658328 100644
--- a/program/include/rcube_mdb2.php
+++ b/program/include/rcube_mdb2.php
@@ -574,7 +574,12 @@
      */
     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);
+        }
     }
 
 

--
Gitblit v1.9.1