Answers for "get time moment"

6

moment js add day

var new_date = moment(startdate, "DD-MM-YYYY").add(5, 'days');
Posted by: Guest on May-15-2020
3

moment check valid date

var date = moment("2016-10-19");
var check = date.isValid();
console.log(check);
Posted by: Guest on March-03-2020
3

javascript get time ago with moment

const dateTimeAgo = moment("2020-04-04 11:45:26.123").fromNow();
console.log(dateTimeAgo); //> 6 minutes ago
Posted by: Guest on April-04-2020
2

moment format heure

var time = "15:30:00";
var formatted = moment(time, "HH:mm:ss").format("LT");
console.log(formatted); 
//it will return 3:30 PM
Posted by: Guest on May-06-2020
-1

moment.js get time from now

moment("20111031", "YYYYMMDD").fromNow(); // 10 years ago
moment("20120620", "YYYYMMDD").fromNow(); // 9 years ago
moment().startOf('day').fromNow();        // 15 hours ago
moment().endOf('day').fromNow();          // in 9 hours
moment().startOf('hour').fromNow();       // an hour ago
Posted by: Guest on June-01-2021
-2

how to get current time using moment

var startDate = moment().subtract(1, 'days'); //one day before the current time
Posted by: Guest on February-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language