How do I display my time in 24h format instead of 12?
I am using moment.js.
I am pretty sure that these lines could have something to do with it.
<
Stating your time as HH
will give you 24h format, and hh
will give 12h format.
You can also find it here in the documentation :
H, HH 24 hour time
h, or hh 12 hour time (use in conjunction with a or A)
//Format 24H use HH:mm
let currentDate = moment().format('YYYY-MM-DD HH:mm')
console.log(currentDate)
//example of current time with defined Time zone +1
let currentDateTm = moment().utcOffset('+0100').format('YYYY-MM-DD HH:mm')
console.log(currentDateTm)
<script src="https://momentjs.com/downloads/moment.js"></script>