moment.js (JS date) Date format processing plug-in powerful,
Official website: http://momentjs.com/You can also view the official website e-text original Moment.js API.
Current date formattingMoment (). Format (' MMMM do YYYY, h:mm:ss a '); April6th2015,3:55:57 pm Moment (). Format (' dddd '); Monday moment (). Format ("MMM do YY"); -April6th15moment (). Format (' YYYY [escaped] YYYY '); -Escaped2015moment (). Format (); -2015-04-06T15:55:57+08:XX---------------------------------------------------Moment (). Format (' Yyyy-mm-dd '); -2015-04-06moment (). Format (' Yyyy-mm-dd h:mm:ss a '); -2015-04-0603:55:57 pmSpecify date formattingMoment ("20111031","YYYYMMDD"). Fromnow (); -3 years ago Moment ("20120620","YYYYMMDD"). Fromnow (); -3 years ago Moment (). StartOf (' Day '). Fromnow (); -16 hours ago Moment (). EndOf (' Day '). Fromnow (); -Within 8 hours Moment (). StartOf (' Hour '). Fromnow (); -1 hours agodate The current date is pushed forward or backward formattedMoment (). Subtract (10,' Days '). Calendar (); -2015March27th Moment (). Subtract (6,' Days '). Calendar (); --Last Tuesday pm3 pips55moment (). Subtract (3,' Days '). Calendar (); --Last Friday pm3 pips55moment (). Subtract (1,' Days '). Calendar (); Yesterday afternoon3 pips55moment (). Calendar (); ---this afternoon3 pips55moment ().Add1,' Days '). Calendar (); Tomorrow afternoon3 pips55moment ().Add3,' Days '). Calendar (); This Thursday afternoon3 pips55moment ().Add10,' Days '). Calendar (); -2015April16thYou can also format the date using the following methodMoment (). Format (' L '); -2015-04-06moment (). Format (' L '); -2015-04-06moment (). Format (' LL '); -2015April6th Moment (). Format (' ll '); -2015April6th Moment (). Format (' LLL '); -20154 month 6th afternoon 3 points 55moment (). Format (4 month 6th afternoon 3 points 55moment (). Format (4 month 6th Monday afternoon 3 points 55moment (). Format (4 month 6th Monday afternoon 3 points 55 practical application, such as can be very convenient to get last week's start date and end date, etc., can flexibly use moment.js various date processing is a cinch,
Turn from:/http www.51xuediannao.com/js/texiao/moment.html
Python Moment.js API