moment date add
var new_date = moment(startdate, "DD-MM-YYYY").add(5, 'days');
moment date add
var new_date = moment(startdate, "DD-MM-YYYY").add(5, 'days');
moment to date
moment().toDate();
moment format date
moment().format(); // "2019-08-12T17:52:17-05:00" (ISO 8601, no fractional seconds)
moment().format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Monday, August 12th 2019, 5:52:00 pm"
moment().format("ddd, hA"); // "Mon, 5PM"
moment format date
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');
moment format date
moment().format('MMMM Do YYYY, h:mm:ss a'); // March 26th 2021, 12:25:33 pm
moment().format('dddd'); // Friday
moment().format("MMM Do YY"); // Mar 26th 21
moment().format('YYYY [escaped] YYYY'); // 2021 escaped 2021
moment().format(); // 2021-03-26T12:25:33-04:00
moment js get french time 20:00:00
moment().format(); // "2014-09-08T08:02:17-05:00" (ISO 8601, no fractional seconds)
moment().format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Sunday, February 14th 2010, 3:25:50 pm"
moment().format("ddd, hA"); // "Sun, 3PM"
moment('gibberish').format('YYYY MM DD'); // "Invalid date"
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us