当从客户端从ajax调用中检索时,我的日期时间在服务器上增加了12.30小时

时间:2022-05-25 16:15:08

The date in database is:8/29/2013 15:27 and i am converting it into a json date and sending it to the client side as a json date .after converting json date in javascript date it is showing me the date is 8/30/2013 3:57 here is my code

数据库中的日期是:2013年8月29日15:27我将它转换为json日期并将其作为json日期发送到客户端。在javascript日期转换json日期后它显示我的日期是8 / 30/2013 3:57这是我的代码

$.get("League/GetMatchupDates", { sportId: spo }, function (data) {
            debugger;
            for (i = 0; i <= data.length; i++) {
                debugger;
                if (data[i] != undefined) {
                    var parsedDate = new Date(parseFloat(/Date\(([^)]+)\)/.exec(data[i])[1]));

1 个解决方案

#1


1  

It's probably a timezone difference. Stick to UTC programmatically and only use timezones when outputting to a user.

这可能是时区差异。以编程方式坚持UTC,仅在输出给用户时使用时区。

#1


1  

It's probably a timezone difference. Stick to UTC programmatically and only use timezones when outputting to a user.

这可能是时区差异。以编程方式坚持UTC,仅在输出给用户时使用时区。