|
Posted by Vincent Delporte on 01/11/07 02:57
On Thu, 11 Jan 2007 02:42:55 +0100, Vincent Delporte
<justask@acme.com> wrote:
>Do I need to call another function in addition to strtotime() to make
>this happen?
For those interested, I found the following code that seems to work:
$mydate = $_POST["mydate"];
//Date formated as dd/mm/yyyy
list($d, $m, $y) = preg_split('/\//', $mydate);
$mydate = sprintf('%4d%02d%02d', $y, $m, $d);
print $mydate;
There may be a better way, such as telling PHP that the dates are
formatted as dd/mm/yyyy instead of mm/dd/yyyy so that strtotime will
work without the above kung-fu, but I don't know.
[Back to original message]
|