Tuesday, 10 September 2013

why do I get different date value after I pass the datetime from javascript to php?

why do I get different date value after I pass the datetime from
javascript to php?

I have a php for handling the time stuff:
[PHP]echo date('Y-m-d H:s', $_POST['time']);
Then I hava a javascript to post the a time value to the php:
[javascript]var $new_time = Math.round((new
Date("2009-09-09T23:15:00")).getTime()/1000);
$.ajax({
url:"...",
data:{time:$new_time},
type: "post",
async: false,
dataType: "html",
success: function(data,textStatus,jqXHR) {
alert(data);
}
});
And in the alert, it shows: 2009-09-10 01:00. Hm, can anyone tell me why
is that?

No comments:

Post a Comment