“format de moment.js” Réponses codées

moment ajouter des secondes

var travelTime = moment().add(642, 'seconds').format('hh:mm A');// it will add 642 seconds in the current time and will give time in 03:35 PM format

var travelTime = moment().add(11, 'minutes').format('hh:mm A');// it will add 11 mins in the current time and will give time in 03:35 PM format; can use m or minutes 

var travelTime = moment().add(2, 'hours').format('hh:mm A');// it will add 2 hours in the current time and will give time in 03:35 PM format
Matteoweb

Moment MAINTENANT FORMAT

var date = moment().format('MM/DD/YYYY');
Open Oyster

Date de format de moment

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"
Matteoweb

format de moment.js

moment().format('MMMM Do YYYY, h:mm:ss a'); // December 4th 2020, 1:04:29 pm
moment().format('dddd');                    // Friday
moment().format("MMM Do YY");               // Dec 4th 20
moment().format('YYYY [escaped] YYYY');     // 2020 escaped 2020
moment().format();                          // 2020-12-04T13:04:29-05:00
Fantastic Finch

format de moment.js

moment("20111031", "YYYYMMDD").fromNow(); // 9 years ago
moment("20120620", "YYYYMMDD").fromNow(); // 8 years ago
moment().startOf('day').fromNow();        // 13 hours ago
moment().endOf('day').fromNow();          // in 11 hours
moment().startOf('hour').fromNow();       // 4 minutes ago
Fantastic Finch

format de moment.js

moment format
Lucky Llama

Réponses similaires à “format de moment.js”

Questions similaires à “format de moment.js”

Plus de réponses similaires à “format de moment.js” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code