|
Posted by Vincent Delporte on 01/11/07 01:42
Hello
My site is hosted on a server in the US, hence set up to use
the mm/dd/yyyy date format instead of the European dd/mm/yyyy.
Also, MySQL stores dates as yyyy-mm-dd, so I need to convert
dd/mm/yyyy to that format. I'm a newbie, and didn't find the answer
through Google :-/
Do I need to call another function in addition to strtotime() to make
this happen?
--------------------
//In the form dd/mm/yyyy
$dateorig = $_POST["dateorig"];
//Doesn't work because server set up to assume mm/dd/yyyy!
$new_dateorig = date("Y-m-d", strtotime($dateorig));
print $new_dateorig;
--------------------
Thank you.
Navigation:
[Reply to this message]
|