Saturday, 2 March 2013

how to format javascript date

 
Moment.js

It is a lightweight (3.7 KB) JavaScript date library for parsing, manipulating, and formatting dates.

var a = moment([2010, 1, 14, 15, 25, 50, 125]);

a.format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Sunday, February 14th 2010, 3:25:50 pm"

a.format("ddd, hA");                       // "Sun, 3PM"

0 comments:

Post a Comment

Leave a comment on blog quality.

Blogger

Related Posts Plugin for WordPress, Blogger...