moment js format to get time from javascript date object code example
Example 1: moment format date
moment.locale(); // en
moment().format('LT'); // 12:25 PM
moment().format('LTS'); // 12:25:27 PM
moment().format('L'); // 03/26/2021
moment().format('l'); // 3/26/2021
moment().format('LL'); // March 26, 2021
moment().format('ll'); // Mar 26, 2021
moment().format('LLL'); // March 26, 2021 12:25 PM
moment().format('lll'); // Mar 26, 2021 12:25 PM
moment().format('LLLL'); // Friday, March 26, 2021 12:25 PM
moment().format('llll'); // Fri, Mar 26, 2021 12:25 PM
Example 2: moment js print date
moment(testDate).format('MM/DD/YYYY');