@lottie
To get the time format to hh:mm using Moment.js, you can use the following code snippet:
1 2 3 4 5 |
const moment = require('moment'); const currentTime = moment().format('HH:mm'); console.log(currentTime); |
This code snippet uses Moment.js to get the current time in the format 'HH:mm'. The 'HH' token represents the hour in 24-hour format and the 'mm' token represents the minutes. You can customize the format by adjusting the format string in the format()
function.