I have a valid date from a database column with varchar type, all in d/m/y format. Then when I try to convert it into a date format with strtotime function and date formating I get 01/01/70. I have even tried to replace the database result with plain string values. I have searched and found this links PHP strtotime returns a 1970 date when date column is null PHP : strtotime() returns always 01/01/1970 strtotime() does not return correct value when specifying date in dd/mm/yyyy format but both were not helpful since the data is not null and it is in valid format. Here is a snippet of my code
if(isset($item['prep_date']) && $item['prep_date'] != NULL){
$trial=$item['prep_date'];
echo ": ".$trial;
$prepDate= strtotime($trial);
$prepDate = date('d/m/y', $prepDate);
echo "= ".$prepDate;
}
What am i missing? Here is the result of the two echoes
28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 03/01/13= 01/03/13: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 18/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 02/09/13= 09/02/13: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 05/11/13= 11/05/13: 28/10/13= 01/01/70: 28/11/13= 01/01/70: 05/11/13= 11/05/13: 28/10/13= 01/01/70: 28/10/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 05/11/13= 11/05/13: 11/12/13= 12/11/13: 11/12/13= 12/11/13: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 11/12/13= 12/11/13: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 30/01/14= 01/01/70