note 64276 deleted from function.strtotime by danbrown
| From: | danbrown@php.net | Date: | Mon, 18 May 2009 02:27:33 +0000 |
| Subject: | note 64276 deleted from function.strtotime by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155654@lists.php.net to get a copy of this message | ||
Note Submitter: jacques dot malan at gmail dot com
----
I have had some inconsistancies that was not immediately evident and suggested that strtotime
treated my date formats in different ways.
I had trouble with the date format: d/m/Y
I eliminated the inconsistancies by changing the date format to one where (i guess) php does not try
and guess the right format. In my case I changed it to the format (d-M-Y) in which case it worked.
Example when trying to find a person's age where:
//$date in format (d/m/Y) was inconsistant but fixed when in format (d-M-Y), e.g. (01-January-2001)
$age = (time() - strtotime($date))/(60*60*24*360);