RE: [PHP] gmtime?
| From: | Ford, Mike [LSS] | Date: | Mon, 27 May 2002 11:22:28 +0000 |
| Subject: | RE: [PHP] gmtime? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-99354@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Jens Lehmann [mailto:newsgroup@developerforum.net]
> Sent: 24 May 2002 20:31
>
> time() returns the number of seconds since the Unix Epoch to
> the current
> local time
>
> gmtime() should return the number of seconds since the Unix
> Epoch to the
> current GM-time
>
> Do you understand now?
Uh, no, actually now I'm more confused!
As I understand it, a Unix timestamp is *always* the number of seconds since 1-Jan-1970 GMT
("the Unix epoch"), and so is always a GMT time. Any function that converts between local
time and a Unix timestamp therefore has to take the current timezone (and any daylight-savings
rules) into account. This is why there are two versions of mktime() and date(), but only one
time().
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211