note 39103 deleted from function.date by kennyt
| From: | kennyt@php.net | Date: | Sun, 18 Jul 2004 17:27:23 +0000 |
| Subject: | note 39103 deleted from function.date by kennyt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-73511@lists.php.net to get a copy of this message | ||
Note Submitter: carneeki@carneeki.net
----
If you want to return a W3 preferred date and time (W3CDTF documentation available at http://www.w3.org/TR/NOTE-datetime) you can use the
following:
<?php echo
substr(date("Y-m-d\Th:i:sO"),0,22).":".substr(date("O"),3);
?>
I don't know how the internals of PHP work when a script executes, but the following may
present a caveat:
If the script is run very very close to the stroke of midnight, and the first date function returns
something along the lines of 2004-01-17T23:59:59+11:00 and the second one returns +10:00 during the
change from daylight savings to normal time. The result, the timezone offset may appear one hour
out.
The likelihood is extremely rare (twice a year if you include the reverse occurring), and timing
would need to be executed very carefully to reproduce this effect. You would also need a very very
slow system to notice the effect.