note 84540 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 03 Aug 2008 11:51:13 +0000 |
| Subject: | note 84540 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-143103@lists.php.net to get a copy of this message | ||
Note Submitter: dmitry dot kruglov at gmail dot com
----
Pretty solution for Australian date format compatibility.
In Australia the date format is: DD/MM/YYYY.
So, 01/05/2008 should be considered as the 1st of May 2008 instead of the 5th of January 2008.
<?php
function strtoautime($datetime)
{
return strtotime(preg_replace("/(\d{2})\/(\d{2})\/(\d{2,4})/", "$2/$1/$3",
$datetime));
}
?>