Awesome JavaScript date processing class library-moment. js

Source: Internet
Author: User
ArticleDirectory
    • Main features:
    • How to use it?

Date: 2012/02/20 Source: gbin1.com

Moment. JS is a lightweight and robust JS date processing class library. I believe that you have written it yourself during Javascript development, or used implementation functions related to Google and Baidu search. This class library helps you effectively process related dates. Hope you like it!

Main features:
    • 3.2kb ultra-lightweight
    • Independent class library, which means you do not need to add a bunch of JS
    • Date Processing supports UNIX timestamp, String, date in the specified format
    • Date Processing: Plus, minus date
    • Date display: including date display options for relative time display
    • Other built-in functions, such as Save, timezone offset, and i18n support
    • It can be used as a module of node. js.
    • Complete Document Introduction
How to use it?
 
VaR now = moment ();
Console. Log (now. Format ('dddd, Mmmm do yyyy, H: mm: SS '));
 
VaR Halloween = moment ([2011, 9, 31]); // October 31st
Console. Log (Halloween. fromnow ());
VaR now = moment (). Add ('days ', 9 );
Console. Log (now. Format ('dddd, Mmmm do yyyy '));
 
VaR now = moment (); moment. Lang ('Fr ');
Console. Log (now. Format ('llll '));

Source: Awesome JavaScript date processing class library-moment. js

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.