Updated on Kisan Patel
Problem:
How to Display JavaScript Date objects in human readable format?
How to Format ISO8601 standard Date object using Moment.js?
Solution:
Here, We will use Moment.js for formatting dates.
Below is the example, how to format ISO8601 date using Moment.js
For formating javascript date object, you need to use Moment.js format
method:
moment(ISO8601_date).format("DD/MM/YYYY"); //format 2015-09-16T22:44:30.652Z to 16/09/2015
moment(new Date(2015, 9, 16)).format("DD/MM/YYYY"); // 16/09/2015
Source:
http://momentjs.com/docs/#/displaying/format/