I receive from a Webservice a String with a date in this format:
yyyy-MM-ddTHH:mm:ss.fffZ
I need to convert that String with JavaScript to
momentjs has the answer to this and many other date problems you might have. While it isn't clear where and how you will user the needed date, neither the wanted format, I think momentjs can give you some of the needed tasks I would add the module to my solution and use as (below is parse.com cloud code):
Parse.Cloud.define("momentFormat", function(request, response){
var message;
var date = momento('2013-01-08T17:16:36.000Z');
response.success("original format date: " + date.format("YYYY-MM-DDTHH:mm:ss.SSSZ") + " new format date: " + date.format("ffffdd, MMMM Do YYYY, h:mm:ss a"));
});
Output:
{"result":"original format date: 2013-01-08T17:16:36.000+00:00 new format date: Tuesday, January 8th 2013, 5:16:36 pm"}