为什么在iOS中,Javascript将时间值添加1小时而在Windows中却不添加小时(根据需要)?

时间:2019-04-07 20:36:42

标签: javascript ios google-chrome datetime datatables

20:00在Windows中是正确的,但是在iOS(Chrome和Safari)中,它以某种方式使时间增加了一个小时

20:00 is correct in Windows but in iOS (Chrome and Safari) it is adding one hour to the time somehow

这是Windows中Chrome控制台中的JavaScript代码。在iOS上无法获得相同的效果

Here is the JavaScript code from Chrome console in Windows. Can't get the same from iOS)

{
                            data: 'eventDateTime',
                            render: function (data, type, fixture) {
                                var d = new Date(data);
                                var monthData = d.getMonth() + 1;
                                var hoursData = d.getHours();

                                return "<a target=_blank href='https://www.betfair.com/exchange/football/event/" + fixture.eventId + "/market?marketId=" + fixture.marketId + "'>" + ('0' + d.getDate()).slice(-2) + '-' + ('0' + monthData).slice(-2) + "<BR>" + ' ' + ('0' + hoursData).slice(-2) + ':' + ('0' + d.getMinutes()).slice(-2) + "</a>";
                            }
                        },

请向我显示正确的JavaScript,以使小时在iOS中与Windows相同。也许在iOS中,英国夏令时会增加+1小时,但我不需要,因为我的时间已经可以满足数据库中的BST调整要求。

0 个答案:

没有答案