note 93127 added to function.date
| From: | AuraatTheWorld at osu1 dot php dot net | Date: | Mon, 24 Aug 2009 23:04:54 +0000 |
| Subject: | note 93127 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159849@lists.php.net to get a copy of this message | ||
Correction to below post:
<?php
$tz = date_default_timezone_get();
date_default_timezone_set('UTC');
for($i=0; $i<7; $i++)
echo date('D', mktime(12, 0, 0, 1, $i+4, 1970)) . '<br />';
date_default_timezone_set($tz);
?>
The previous version would fail if your time zone were 12 or more hours from UTC. If you know this
will not be the case then it's safe to use, but if there's a chance your script will ever
run on a server in one of those time zones, this is a better idea.
----
Server IP: 72.55.140.6
Probable Submitter: 207.229.58.28
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/93127
Del: integrated -- https://master.php.net/note/delete/93127/integrated
Del: useless -- https://master.php.net/note/delete/93127/useless
Del: bad code -- https://master.php.net/note/delete/93127/bad+code
Del: spam -- https://master.php.net/note/delete/93127/spam
Del: non-english -- https://master.php.net/note/delete/93127/non-english
Del: in docs -- https://master.php.net/note/delete/93127/in+docs
Del: other reasons-- https://master.php.net/note/delete/93127
Reject -- https://master.php.net/note/reject/93127
Search -- https://master.php.net/manage/user-notes.php