note 77116 added to function.strtotime
| From: | JustinB at at at harvest dot org | Date: | Thu, 16 Aug 2007 02:42:29 +0000 |
| Subject: | note 77116 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129510@lists.php.net to get a copy of this message | ||
@smartalco:
Since the first day of a month is always the first (unless I missed something in History), you could
save yourself some overhead from the second strtotime() by forcing the day manually:
<?php
echo date('l, F jS Y', strtotime('August 1 2007'));
// Outputs "Wednesday, August 1st 2007"
?>
While it's a relatively minor performance difference in a small script, it would be compounded
significantly in larger applications or loops.
----
Server IP: 69.147.83.197
Probable Submitter: 64.118.163.18
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- https://master.php.net/note/edit/77116
Del: integrated -- https://master.php.net/note/delete/77116/integrated
Del: useless -- https://master.php.net/note/delete/77116/useless
Del: bad code -- https://master.php.net/note/delete/77116/bad+code
Del: spam -- https://master.php.net/note/delete/77116/spam
Del: non-english -- https://master.php.net/note/delete/77116/non-english
Del: in docs -- https://master.php.net/note/delete/77116/in+docs
Del: other reasons-- https://master.php.net/note/delete/77116
Reject -- https://master.php.net/note/reject/77116
Search -- https://master.php.net/manage/user-notes.php