Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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
The 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.
Add a comment
new Date(Date.parse("2011-10-30T18:30:00Z")).toString()
str=str.replace(/T|\:\d\dZ/g,' ')
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.