Moment. js is a lightweight and robust js date processing class library. I believe that you have written it yourself during javascript development, you can also use this class library to implement functions related to google and Baidu search, which can help 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?
The Code is as follows:
Var now = moment ();
Console. log (now. format ('dddd, MMMM Do YYYY, h: mm: ss '));
The Code is as follows:
Ar halloween = moment ([2011, 9, 31]); // October 31st
Console. log (halloween. fromNow ());
The Code is as follows:
Var now = moment (). add ('days ', 9 );
Console. log (now. format ('dddd, MMMM Do yyyy '));
The Code is as follows:
Var now = moment (); moment. lang ('Fr ');
Console. log (now. format ('llll '));
Moment_jb51.rar package download