note 57441 deleted from function.gmstrftime by betz
| From: | betz@php.net | Date: | Tue, 04 Oct 2005 13:32:15 +0000 |
| Subject: | note 57441 deleted from function.gmstrftime by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96343@lists.php.net to get a copy of this message | ||
Note Submitter: Learner
----
Dear all,
I feel so confuse about the Date & Time function in PHP, and I don't know what the BEST way
to get a GMT timestamp in PHP.
Here are the testing data from my server (Windows Server 2003, IIS 6, PHP 4, GMT+08:00), and I try
to find a GMT timestamp for my application.
// this is server time with timezone info
date("r") = Tue, 4 Oct 2005 21:21:58 +0800
// this it server time too
date("Y-m-d H:i:s T(O)") = 2005-10-04 21:21:58 China Standard Time(+0800)
// use mktime() to get the timestamp, but it is a GMT timestamp??? I try to convert it using
javaScript: Tue, 4 Oct 2005 13:21:58 UTC
mktime() = 1128432118
// this is gmdate
gmdate("Y-m-d H:i:s (O)") = 2005-10-04 13:21:58 (+0000)
// this is gmmktime, but it is Tue, 4 Oct 2005 21:21:58 UTC
gmmktime() = 1128460918
Or I disunderstood the difference between mktime() and gmmktime()? Or mktime() is return GMT but
gmmktime() return timezone's time?
In short, what the function or way to get a GMT time that no need concern the server's timezone
setting?