note 43306 deleted from function.time by aidan
| From: | aidan@php.net | Date: | Sat, 08 Oct 2005 01:05:32 +0000 |
| Subject: | note 43306 deleted from function.time by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96627@lists.php.net to get a copy of this message | ||
Note Submitter: webmaster at programmershaven dot org
----
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);