我正在寻找jquery中的函数,它可以给我相同的时间格式,就像这样。
date( 'Y-m-d\TH:i:sP');
//the output is like this.
2013-10-30T18:10:28+01:00
我需要这种格式,但是在 jquery 中,用于放入我的变量中。
谢谢!
最佳答案
JavaScript 和 jQuery 都没有内置库方法来一步完成此操作。您可以找到各种插件来提供帮助,或者编写自己的插件:
参见Where can I find documentation on formatting a date in JavaScript?
并查看http://momentjs.com/或https://github.com/phstc/jquery-dateFormat
关于javascript - 时间戳 php 转 jquery 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21859183/