moment

npm install moment --save  #npm

const moment = require('moment'); //require

moment().format('MMMM Do YYYY, h:mm:ss a'); // February 13th 2021, 1:49:03 am
moment().format('dddd');                    // Saturday
moment().format("MMM Do YY");               // Feb 13th 21
moment().format('YYYY [escaped] YYYY');     // 2021 escaped 2021
moment().format();                         	// 2021-02-13T01:49:29+01:00
moment("20111031", "YYYYMMDD").fromNow(); 	// 9 years ago
moment("20120620", "YYYYMMDD").fromNow(); 	// 9 years ago
moment().startOf('day').fromNow();        	// 2 hours ago
moment().endOf('day').fromNow();          	// in a day
moment().startOf('hour').fromNow();      	// an hour ago
moment().subtract(10, 'days').calendar(); 	// 02/03/2021
moment().subtract(6, 'days').calendar();  	// Last Sunday at 1:50 AM
moment().subtract(3, 'days').calendar();  	// Last Wednesday at 1:50 AM
moment().subtract(1, 'days').calendar();  	// Yesterday at 1:50 AM
moment().calendar();                      	// Today at 1:50 AM
moment().add(1, 'days').calendar();       	// Tomorrow at 1:50 AM
moment().add(3, 'days').calendar();       	// Tuesday at 1:50 AM
moment().add(10, 'days').calendar();     	// 02/23/2021
moment.locale();         					// en
moment().format('LT');   					// 1:50 AM
moment().format('LTS');  					// 1:50:49 AM
moment().format('L');    					// 02/13/2021
moment().format('l');    					// 2/13/2021
moment().format('LL');   					// February 13, 2021
moment().format('ll');   					// Feb 13, 2021
moment().format('LLL');  					// February 13, 2021 1:50 AM
moment().format('lll');  					// Feb 13, 2021 1:50 AM
moment().format('LLLL'); 					// Saturday, February 13, 2021 1:50 AM
moment().format('llll');					// Sat, Feb 13, 2021 1:51 AM

0
0
Krish 100200 points

                                    moment().format('MMMM Do YYYY, h:mm:ss a'); // May 22nd 2020, 6:00:23 pm
moment().format('dddd');                    // Friday
moment().format("MMM Do YY");               // May 22nd 20
moment().format('YYYY [escaped] YYYY');     // 2020 escaped 2020
moment().format();                          // 2020-05-22T18:00:23+05:30

0
0
3.86
7
Phoenix Logan 186120 points

                                    npm install moment

3.86 (7 Votes)
0
3.67
6
Awgiedawgie 440220 points

                                    moment("20111031", "YYYYMMDD").fromNow(); // há 9 anos
moment("20120620", "YYYYMMDD").fromNow(); // há 8 anos
moment().startOf('day').fromNow();        // há 13 horas
moment().endOf('day').fromNow();          // em 11 horas
moment().startOf('hour').fromNow();       // há 10 minutos

3.67 (6 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
moment javascript date javascript .moment() moment .js moment js.com moment js ins moment.js' docs moment js node js momentjs com moment.js node moment(,) momenet js moment js node js example moment() ? moment. js moment js en nodejs moment() momentjs docas moment js api momentjs.com moment moment jquery what is moment js moment js i use moment.js in js moment js min momentjs. moment.js.time jquery moment js use moment js momentj js moment() node moment js io momentjs what is what is moment.js used for moment js api docs js moment docs momentjs.com docs moment js and node js moment js o moment.js doc moment.min.jscdn moment,js download javascript moment() moment..js momentjs date moment.js + jquery momemt.js moments js moment js official documentation moment js OBJECT moment.s time moment.js moment.min.js" moment date js momemt js momnt js js moments Moment. js. moment js dow date moment.js jsdelivr moment script moment.js javascript moment.js moment js n moment js moment javascript documentation momente.js momento js nodejs moment moment.js download moment js time js moment format moment js tc moment() in javascript node moment js use moment js in js node js moment moment definition momentjs docume javascript moment js moment js node _i moment js moment() in js js moment() momentjs in browser moment node moment.js library moment node js moment() js what is moment in js nodejs moment js momento movie this moment moment js browser format moment js moment js docs what is moment.js momentjs docs moment time js moment.js docs moment.js documentation moment.min.js momentjs documentation moment.js what is moment js doc moment() javascript moment js javascript momentjs ie moment js jquery moment in js new moment js moment js documentation moment js' "Moment.js" js momentjs moment js date moment js format moment.js date momentjs format moment js import moment synonym moment vendor moment in javascript get time using moment import moment library data moment format npm i moment-with-locales moment.js latest version momentjs.com format for mini jsfiddle with moment js moment.js typescript momen() in js it.moment js typescript moment moment js with node js moment for angular archive a moment moment.js refresh] archive a moment moment.js npm 'moment' import moment in javascript moment package for current time import momentjs what is moment() albanian language in moment js npm moment created at momentum js express moment to date React "moment": "^2.29.1" install moment npm cdn moment.js moment latest version minified moment latest version 2020-12-14T21:17:11.199Z find diff with current time momet js display hour moment.js moment().hour format in moment momentjs ago momento date validation lll format yarn moment moment() in react moment js node typescript moment.js 1606798800 npm moment format date moment express moment min js what is moment react moment( 'moment.js.map' moment.js ago what does the package moment do moment-with-locales.min.js moment js scripts moment().format moment api angular new versions of moment angular momentformat moment js npm install momnent formats use moment in node js moment^2.24.0 is free moment-with-locales js moment moment formatting date ionic 5 moment format date yarn add moment not working on android release moment npm format date download moment.js file moment yarn moment() react native moment js link npm install moment save moment nodejs yarn add moment momentjs link link for moment.js moment library react sownload moment js min file how to see version of moment js download moment js momentjs.com minify moment.js moment js download moment.min install moment yarn add moment format moment js ':' '/' parshing date with npm moment format data moment moment js install moment with locale bower install does moment js need to be downloaded react moment js moment javascript library moment js latest version add hs and mins to date moment js moment().to js node momentjs momentum to datetime js moment js format dae momen js momentjs download meoment js frech how to use npm moment in html momment js install moment js import moment in node js moment js react link moment js to id moment js yarn add locales js moment momenjs format date momentjs install momment js jquery mment js moments js discord.js moment moment js license install momentjs moment js javascript src https://momentjs reacr moment react js moment js com add moment js to node module Moment.js lib moment npm momemnts js jquery download moment appmonet js react js moment moment js npm package momemnt js npm moment.js update moment js using npm mement react moment react native momnet js npm moment js momeny js date and time reactjs npm install moment js moment js library momentum js library react native moment moment javascript moment js in node js mement js how to use moment in node js momnt js npm check momwent,js verison moment nodejs moment js format date moement js javascript moment lil date library js moment.js yarn javascript moment js time format library install moment js react using yarn yarn add moment for react moment fomats import moment momentjs.com format moment,js momenet.jss moment JS .com moment().format() moment.js . moment.js link momenttz mement.js moment format l monmentjs moment js npm moment() moment().calendar() moment format react native moment example moment js package moment library npm momentjs moment.js français "h" add moment js npm momentjs english locale size format moment moment date format moment.js npm moment moments.js moemntjs date moment moment js format french discord.js moment date moment moment js
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source