JavaScript中的日期格式转换 [英] Date format conversion in JavaScript
问题描述
我想知道转换这种格式的时间戳的最佳方法是什么-
I wondering what is the best way to convert a timestamp of this format -
2012-02-18 14:28:32
以这种格式显示日期-
Saturday Feb 2012 14:28:32
非常感谢:)
推荐答案
JavaScript日期函数非常糟糕...您可以选择转换为UTC http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_toutcstring
Javascript date functions are pretty bad... You have the option to convert to UTC http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_toutcstring
但是如果是我,我会研究Datejs: http ://www.datejs.com/ 最适合我的javascript日期API
But if it was me, i would look into Datejs: http://www.datejs.com/ best javascript date api for me
请查看Datejs入门: http://www.datejs.com/2007/11/27/getting-started -with-datejs /
Please take a look at the getting started with Datejs: http://www.datejs.com/2007/11/27/getting-started-with-datejs/
这篇关于JavaScript中的日期格式转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!