简体   繁体   English

使用 javascript 将 ISO 日期转换为文本

[英]Convert ISO Date to Text with javascript

How would I convert this timestamp我将如何转换此时间戳

2016-06-05T00:00:00.000Z

Into this:进入这个:

Sunday June 6th 2016

With the given timestamp, you can convert it into a Javascript Date Object .使用给定的时间戳,您可以将其转换为 Javascript 日期对象 Then with the date object you get either manually construct what you want or use getTimeString.然后使用日期对象,您可以手动构建您想要的内容或使用 getTimeString。 You can check the full api for date objects on the MDN page.您可以在 MDN 页面上查看日期对象的完整 API。

最终使用这个简单的库: http : //blog.stevenlevithan.com/archives/date-time-format

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM