Python Moment.js API

Source: Internet
Author: User

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 formatting
Moment (). 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.