note 76263 deleted from function.gmmktime by danbrown

From: Date: Sun, 20 Jul 2008 03:17:54 +0000
Subject: note 76263 deleted from function.gmmktime by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142045@lists.php.net to get a copy of this message
Note Submitter: Robert Chapin ---- dim dot zol: Check your clocks sir ;) time() returns the local clock under PHP 4, so the mistake is addition. If gmmktime() is adding the offset to local time then it is officially broken. Example: Program run at 09:52 zulu echo date('Y-m-d H:i:s', time() - intval(date('Z'))).'<br />'; echo date('Y-m-d H:i:s', gmmktime()); echo date('Y-m-d H:i:s', time() + intval(date('Z'))).'<br />'; echo date('Y-m-d H:i:s', gmmktime()); Results: 2007-07-08 09:52:22 2007-07-07 21:52:22 2007-07-07 21:52:57 2007-07-07 21:52:57 Robert Chapin Chapin Information Services

« previous php.notes (#142045) next »