I get date from Web Service have format date like "2013-02-06T10:40:56.027" how to convert it to "2/6/2013 2:40 AM".

Web Service I get from SocialDataService of Sharepoint 2010
I try moment javascript:
var date = moment(lastModifiedTime);
var result = date.format("MM/DD/YYYY hh:mm A");
but result not correct hour: 02/06/2013 10:40 AM
I expected result: 02/06/2013 2:40 AM
if you can assume your service returns UTC time, you could try something like:
moment.utc(result_from_service).local()
for more details: http://momentjs.com/docs/#/manipulating/utc/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With