The code
const d = new Date('2021-08-04T18:33:43.0000000Z')
.toLocaleString('en-US', {hour12: false, timeZone: "Asia/Kolkata"})
console.log(d)
is providing result as "8/5/2021, 24:03:43".
Here '24' hr should be shown as '00' hr. Is this a toLocaleString function issue?
I need to use as above syntax because, date format should be browser language date format and time should be 24 hr format.
For other language its works fine, for example GB
const d = new Date('2021-08-04T18:33:43.0000000Z')
.toLocaleString('en-GB', {hour12: false, timeZone: "Asia/Kolkata"})
console.log(d)
will provide result as "05/08/2021, 00:03:43".
So can someone help me how to get the correct 24 hour format time by using toLocaleString function?