admin管理员组文章数量:1187336
I have a UTC date string, "2011-10-30T18:30:00Z", and I want to convert it to "2011-10-30 18:30". Can anyone give me some advice how to do this? I would appreciate for your time and consideration.
Thanks
I have a UTC date string, "2011-10-30T18:30:00Z", and I want to convert it to "2011-10-30 18:30". Can anyone give me some advice how to do this? I would appreciate for your time and consideration.
Thanks
Share Improve this question asked Oct 10, 2011 at 3:17 SinalSinal 1,1655 gold badges17 silver badges37 bronze badges2 Answers
Reset to default 22The easiest solution is to try the following:
var date = new Date("2011-10-30T18:30:00Z");
This will convert it into a normal Javascript date, at which point you can use whatever data operators you like.
str=str.replace(/T|\:\d\dZ/g,' ')
本文标签: Convert UTC Date to datetime string JavascriptStack Overflow
版权声明:本文标题:Convert UTC Date to datetime string Javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738351479a2079056.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论