note 84985 modified in function.strtotime by danbrown
| From: | danbrown@php.net | Date: | Sat, 25 Oct 2008 05:50:11 +0000 |
| Subject: | note 84985 modified in function.strtotime by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145739@lists.php.net to get a copy of this message | ||
strtotime() seems to treat dates delimited by slashes as m/d/y and dates delimited by dashes are
treated as d-m-y.
<?php
print date('Y-m-d', strtotime("06/08/2008"));
?>
returns 2008-06-08
while
<?php
print date('Y-m-d', strtotime("06-08-2008"));
?>
returns 2008-08-06
Using PHP 5.2.6
--was--
strtotime() seems to treat dates delimited by slashes as m/d/y and dates delimited by dashes are
treated as d-m-y.
print date('Y-m-d', strtotime("06/08/2008"));
returns 2008-06-08
while
print date('Y-m-d', strtotime("06-08-2008"));
returns 2008-08-06
Using PHP 5.2.6
http://php.net/manual/en/function.strtotime.php