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

My datetime is increasing by 12.30 hours on server when retrieving from client side from ajax call

本文关键字:日期 时间 30小时 服务器 增加 调用 ajax 客户端 检索      更新时间:2023-09-26

数据库中的日期为:8/29/2013 15:27,我正在将其转换为json日期并将其作为json日期发送到客户端。在将json日期转换为javascript日期后,它显示日期为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]));

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