moment js display time code example
Example 1: format a date moment
moment(testDate).format('MM/DD/YYYY');
Example 2: 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"
Example 3: moment set time
const date = "2017-03-13";
const time = "18:00";
const timeAndDate = moment(date + ' ' + time);
console.log(timeAndDate);