I am the following code to convert this date -> 18/07/2013
to a mysql
supported format.
$date = date('Y-m-d', strtotime('18/07/2013'));
Ideally this should return 2013-07-18
...
But, the problem is that it automatically selects the string as:
YEAR as YEAR
MONTH as DAY
DAY as MONTH
Now, because it identifies 18
as a month
, it gets out of range and it shows the default date 1970-01-01
.
I have wasted almost two days on this thing.
If anyone can help, thanks in advance!