Forum Moderators: coopster
I am parsing two different document and extracting date from there. But the problem is that when I try to convert them into time using the same function, their values are saved differently. Why is it so? Can anyone tell me?
The date is in the format : 2008-04-13
The function to convert it is :
function mkTime($date, $separator)
{
$date = explode($separator, $date); //in the above case is "-"
$date = mktime(0,0,0,$date[1], $date[2], $date[0]);
return trim($date);
}
And here is an example of the ambiguous result :
These two different values of date are 1184696100 and 1184734800
When I echo them using the date function : date("F d, Y", $date), the response in the both the cases is July 18, 2007
Please help...