简体   繁体   English

“新日期(“ 2013-08-08T09:40”)”在jweek日历插件中不起作用

[英]`new Date(“2013-08-08T09:40”)` not working in jweek calendar plugin

I have problem with jquery weekcalendar demo plugin Its work in Mozilla but not in Chrome . 我对jquery weekcalendar demo plugin有问题,它可以在Mozilla中工作,但不能在Chrome中工作。

I Found Problem its with Datetime : 我发现问题与Datetime

In DEMO.JS File : DEMO.JS文件中:

  alert(new Date("2013-08-08T09:40"));

so its work with Mozilla Firefox with output Its fine 因此它可以与Mozilla Firefox一起使用,并且输出良好

在此处输入图片说明

But in Chrome (Version 28.0.1500.95m) its not working : Wrong output : 但是在Chrome(版本28.0.1500.95m)中,它不起作用:输出错误:

在此处输入图片说明

So please help me out . 所以请帮帮我。 I need same output with chrome also 我也需要与chrome相同的输出

Proper format is 正确的格式是

new Date("2013-08-08T09:40Z");

http://www.w3.org/TR/NOTE-datetime http://www.w3.org/TR/NOTE-datetime

If you want to play the local timezone game then you must manually calculate the offset you want and use it in the format: 如果要玩本地时区游戏,则必须手动计算所需的偏移量,并使用以下格式:

new Date("2013-08-08T09:40+05:30");

It is easier to just use UTC though. 不过,仅使用UTC更容易。

If you don't want to specify any timezone, you need to use different constructor: 如果您不想指定任何时区,则需要使用其他构造函数:

new Date(2013, 7, 8, 9, 40);

This will result in an instant that is dependent on whatever timezone settings the user has on their computer. 这将导致瞬间取决于用户在计算机上设置的时区设置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何格式化这种日期时间2013-03-12T22:15:40 + 08:00到“2012年3月12日02:15:40 UTC”? - How can I format this kind of date time 2013-03-12T22:15:40+08:00 to “12 Mar 2012 02:15:40 UTC”? 无法从包含milisec的日期创建新的Date()对象'2015-05-14 08:08:48.792' - Cannot create a new Date() object from a date that contain milisec '2015-05-14 08:08:48.792' 为什么在JavaScript中使用Date.UTC(2015,08,31)== Date.UTC(2015,09,01)? - Why Date.UTC(2015, 08, 31) == Date.UTC(2015, 09, 01) in javascript? 为什么 new Date("2022-08-31").toISOString() 在 console.log() 中显示为 2022-08-30T18:30:00.000Z? - Why new Date("2022-08-31").toISOString() is shown as 2022-08-30T18:30:00.000Z in console.log()? 在Javascript中使用新日期(“2014年8月11日”)和新日期(“2014-08-11”)的不同日期 - Different dates when used new Date(“2014 Aug 11”) and new Date(“2014-08-11”) in Javascript 将日期转换为格式2019-05-31T12:08:04Z momentjs - convert date into format 2019-05-31T12:08:04Z momentjs 如何拥有这种格式“2020-08-08T03:20:14.362+00:00” - How to have this format “2020-08-08T03:20:14.362+00:00” Javascript:如何编辑从7,8,9,10到07,08,09,10的数组元素? - Javascript: how to Edit array elements from 7,8,9,10 to 07,08,09,10? 如何将类似日期的字符串(例如“ 2014-08-18T03:29:12.000Z”)转换为秒? - How can I convert a date-like string eg “2014-08-18T03:29:12.000Z” to seconds? vue-good-table 日期格式 2019-02-26T02:11:56.308466-08:00 - vue-good-table date format 2019-02-26T02:11:56.308466-08:00
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM