Javascript时间格式问题
我现在遇到了 Javascript 和名为“JMonthCalendar”的插件的问题。问题本质上是使用“Date(2011,6,6)”将返回如下信息:“Wed Jul 06 2011 00:00:00 GMT-0500 (Central Daylight Time)”。这不起作用,该插件确实如此 的
然后我尝试查找时间戳,但这也不是我想要的:“1311742800000”
我需要的是这样的:“2011-06-28T00:00:00.0000000”
是否有预先编程 如果没有,您建议我如何最好地做到这一点?
谢谢您的帮助
编辑:这是有问题的网站和页面,我现在正在测试它,如果它看起来很奇怪,那就是。为什么。-- http://powerqualityuniversity.net/?d=registration&p=calendar
I am having an issue with Javascript right now and a plugin named "JMonthCalendar". The problem is essentially that using the "Date(2011, 6, 6) will return information like this: "Wed Jul 06 2011 00:00:00 GMT-0500 (Central Daylight Time)". This will not work, the plugin does not read this format.
I then tried to look up timestamps, but this is not what I want either: "1311742800000"
What I need is something like this: "2011-06-28T00:00:00.0000000"
Is there a pre-programmed function for this? If not, how would you propose that I could best do it?
Thank you for your help.
EDIT: Here is the website and page that is in question, I am testing it right now so if it seems odd, thats why. -- http://powerqualityuniversity.net/?d=registration&p=calendar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
它可能不是最性感的解决方案,但由于 Javascript 没有任何内置的本机日期格式化功能,您需要自己实现它们。
Try this:
It might not be the sexiest solution, but since Javascript afaik doesn't have any native date formatting functionality built in you need to implement them yourself.