Forum Moderators: coopster

Message Too Old, No Replies

same date different values

how is it possible?

         

ayushchd

7:02 am on Apr 13, 2008 (gmt 0)

10+ Year Member



Hi all!

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...

cameraman

5:39 pm on Apr 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm getting the 17th on that first one, but try changing the name of your function - unlike variables, function names are case insensitive.