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

329
Views
Angular - Is there a way to know what is the user's device time format ? 24h system vs 12 am/pm system

Is it possible to know if the user's time format is 24h or 12h system in Angular ? Thanks in advance

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

0

I had to do something similar a while back, this is what worked for me.

var date = new Date(Date.UTC(2012, 11, 12, 3, 0, 0));
var dateString = date.toLocaleTimeString();


if (dateString.match(/am|pm/i) || date.toString().match(/am|pm/i) )
{
    //12 hour clock
    console.log("12 hour");
}
else
{
    //24 hour clock
    console.log("24 hour");
}
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!