note 71972 rejected from function.strtotime by bjori
| From: | bjori@php.net | Date: | Wed, 27 Dec 2006 13:37:28 +0000 |
| Subject: | note 71972 rejected from function.strtotime by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-120949@lists.php.net to get a copy of this message | ||
Note Submitter: nicholas at nicholaswilliams dot info
----
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