moment js get timestamp code example
Example 1: moment add seconds
var travelTime = moment().add(642, 'seconds').format('hh:mm A');
var travelTime = moment().add(11, 'minutes').format('hh:mm A');
var travelTime = moment().add(2, 'hours').format('hh:mm A');
Example 2: format a date moment
moment(testDate).format('MM/DD/YYYY');
Example 3: moment js get french time 20:00:00
moment().format();
moment().format("dddd, MMMM Do YYYY, h:mm:ss a");
moment().format("ddd, hA");
moment('gibberish').format('YYYY MM DD');
Example 4: momentjs utcoffset
moment().utcOffset()
Example 5: moment format heure
var time = "15:30:00";
var formatted = moment(time, "HH:mm:ss").format("LT");
console.log(formatted);