Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

447
Views
why is time format getting changed for 00:00:00 time in UTC 24 hour format to 24:00:00

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

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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);

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!