note 43306 added to function.time

From: Date: Thu, 17 Jun 2004 04:28:31 +0000
Subject: note 43306 added to function.time
Groups: php.notes 
Request: Send a blank email to php-notes+get-71186@lists.php.net to get a copy of this message
It seems senseless to do the manipulation shown previous to this note, to show the date in GMT. Why? The time() function returns the timestamp in GMT. The date() function adds the offset of the server to this timestamp. Using gmdate(), however, passes the time right through without adding any offsets at all. Thus to get the GMT time: echo gmdate('l, F j, Y', time()); But to get the time of, say, GMT -0100: echo gmdate('l, F j, y', time() - 3600); ---- Manual Page -- http://www.php.net/manual/en/function.time.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43306 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43306&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43306&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#71186) next »