RE: [PHP] gmtime?
| From: | Matt Friedman | Date: | Mon, 27 May 2002 12:37:20 +0000 |
| Subject: | RE: [PHP] gmtime? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99358@lists.php.net to get a copy of this message | ||
Unix epoch is the number of secs since the start date in GMT regardless
of where your server is. The timestamp is a GMT value.
Matt Friedman
Web Applications Developer
www.SpryNewMedia.com
-----Original Message-----
From: Jens Lehmann [mailto:newsgroup@developerforum.net]
Sent: Monday May 27, 2002 7:48 AM
To: php-general@lists.php.net
Subject: Re: [PHP] gmtime?
> > -----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!
I can understand that you're confused. :-) Or am I?
> 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.
Imho no, because 1-Jan-1970 GMT is just the "starting point",
the result depends on which timezone your server is located in.
Please correct me if I'm wrong here!
> 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
>
Jens
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php