“Moment.js formato” Respostas de código

momento adicione segundos

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

momento agora formato

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

Data do formato do momento

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

Moment.js formato

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

Moment.js formato

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

Moment.js formato

moment format
Lucky Llama

Respostas semelhantes a “Moment.js formato”

Perguntas semelhantes a “Moment.js formato”

Mais respostas relacionadas para “Moment.js formato” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código