I have the date as:
var date = new Date('2021-08-25T00:00:00.000+00:00');
I am formatting time as:
time = date.toLocaleTimeString('en-Us', {
hour12: false,
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
timeZone: 'UTC',
});
Why the time is getting changed to 24:00:00 instead of 00:00:00. And how can i have it as 00:00:00
Using en-Gb
fixes it.
var date = new Date('2021-08-25T00:00:00.000+00:00');
let time = date.toLocaleTimeString('en-Gb', {
hour12: false,
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
timeZone: 'UTC',
});
console.log(time);