From: Fredrik J. <fr...@po...> - 2005-05-04 11:45:34
|
My provider runs SuSE Linux with MySQL 4.0.18 and this code makes dates show up something like "4: 2005051200", not so nice. $mysqlVer = mysql_get_server_info(); if (!preg_match("/^4\./", $mysqlVer)) { $time = mktime(substr($timestamp, 8, 2), substr($timestamp, 10, 2), substr($timestamp, 12, 2), substr($timestamp, 4, 2), substr($timestamp, 6, 2), substr($timestamp, 0, 4)); return date('Y.m.d H:i:s', $time + $TimeZoneOff * 60); } else { This need more tuning according to sql_mode: MAXDB-setting, DATETIME vs TIMESTAMP return "4: " . $timestamp; // NOT corrected according to $TimeZoneOFf?! } When I just use this code like in tavi 0.25 everything works fine. $time = mktime(substr($timestamp, 8, 2), substr($timestamp, 10, 2), substr($timestamp, 12, 2), substr($timestamp, 4, 2), substr($timestamp, 6, 2), substr($timestamp, 0, 4)); return date('Y.m.d H:i:s', $time + $TimeZoneOff * 60); Fredrik -- Web site: <http://xdeb.org/wiki/Fredrik> |