i need to convert a date string into this format: "d/m/Y" the date string to convert from, is not always the same, sometimes its 07/02/2014, sometimes 13/02/2014 and sometimes 2014-02-07.
i'm using this command for conversion:
date("d/m/Y", strtotime($datestring))
i noticed that sometimes i get 01/01/1970 because of a false that strtotime returns.
i narrowed it down to this:
strtotime("07/02/2014")
returns 1409605200 which is ok....
strtotime("13/02/2014")
returns false !!!!
read all the posts about strtotime here , in this forum. also this solution won't help because i don't know the specific format in advance:
$a = strptime('22-09-2008', '%d-%m-%Y');
$timestamp = mktime(0, 0, 0, $a['tm_mon']+1, $a['tm_mday'], $a['tm_year']+1900);
what is the problem here?? what is the solution i need?