From be4d182b75da56b0de171726f95f78a97c764548 Mon Sep 17 00:00:00 2001
From: till <till@php.net>
Date: Sun, 03 Feb 2008 11:13:33 -0500
Subject: [PATCH] * fixed retrieval of timestamp from db

---
 check.php |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/check.php b/check.php
index 685ee40..c87b8be 100644
--- a/check.php
+++ b/check.php
@@ -105,8 +105,13 @@
     $DB = new rcube_mdb2($rcmail_config['db_dsnw'], '', false);
     $DB->db_connect('w');
     
-    $tz_db    = $DB->unixtimestamp($DB->now());
-    $tz_local = time();
+    $tz_db    = "SELECT " . $DB->unixtimestamp($DB->now()) . " AS tz_db";
+    $tz_db    = $DB->query($tz_db);
+    $tz_db    = $DB->fetch_assoc($tz_db);
+    $tz_db    = (int) $tz_db['tz_db'];
+    $tz_local = (int) time();
+    $tz_diff  = $tz_local - $tz_db;
+
     if ($tz_db != $tz_local) {
         echo 'NOT OK';
     } else {
@@ -158,4 +163,4 @@
 }
 echo '<br />';
  */
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1