note 71972 added to function.strtotime
| From: | nicholas at nicholaswilliams dot info | Date: | Wed, 27 Dec 2006 07:50:24 +0000 |
| Subject: | note 71972 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120941@lists.php.net to get a copy of this message | ||
This is interesting. In PHP 4.3.x, where as the first code outputs "2007-01-17 12:00 am",
the second code snippet outputs "2007-10-28 12:00 am".
<?php
// outputs "2007-01-17 12:00 am"
$t = strtotime('01/17/2007');
echo date('Y-m-d g:i a', $t);
// outputs "2007-10-28 12:00 am"
$t = strtotime('01-17-2007');
echo date('Y-m-d g:i a', $t);
?>
Just thought I'd let those of you who were as confused as I was know about the discrepancy. It
seemed to me like both of those would be interpreted the same.
N
----
Server IP: 64.71.164.2
Probable Submitter: 69.180.200.126
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- https://master.php.net/note/edit/71972
Del: integrated -- https://master.php.net/note/delete/71972/integrated
Del: useless -- https://master.php.net/note/delete/71972/useless
Del: bad code -- https://master.php.net/note/delete/71972/bad+code
Del: spam -- https://master.php.net/note/delete/71972/spam
Del: non-english -- https://master.php.net/note/delete/71972/non-english
Del: in docs -- https://master.php.net/note/delete/71972/in+docs
Del: other reasons-- https://master.php.net/note/delete/71972
Reject -- https://master.php.net/note/reject/71972
Search -- https://master.php.net/manage/user-notes.php