note 48419 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 14 Aug 2005 11:51:16 +0000 |
| Subject: | note 48419 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-93596@lists.php.net to get a copy of this message | ||
Note Submitter: Jeremy - phpnet AT jagged DOT co DOT nz
----
For the "rest of the world" who dont use american date format
ie. use dd/mm/yy NOT mm/dd/yy
Using the pregmatch line shown below should convert any dates in this format to the correct
format...
HOWEVER dates in yy/mm/dd will no longer be able to be parsed, not a big loss if you ask me.
$input = "12/02/05";
echo date('d M Y',strtotime($input));
$input = preg_replace( '/(\d{2})\W(\d{2})\W(\d{2}|\d{4})/', '$2/$1/$3', $input);
echo date('d M Y',strtotime($input));