将UTC日期转换为datetime字符串Javascript

将UTC日期转换为datetime字符串Javascript

本文介绍了将UTC日期转换为datetime字符串Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UTC日期字符串2011-10-30T18:30:00Z,我想将其转换为2011-10-30 18:30。任何人都可以给我一些建议如何做到这一点?感谢您的时间和考虑。

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.

谢谢

推荐答案

str=str.replace(/T|\:\d\dZ/g,' ')

这篇关于将UTC日期转换为datetime字符串Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 02:07