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

229
Views
How to format date in a system date format using Angular

I want to convert the date into a system date format. For Example, if the system date format is DD-MM-YYYY, then my web application should show 30-11-2021, and on another system, if the date format is MM-DD-YYYY, then it should show 11-30-2021. Basically, it should convert to the date format of the client's system.

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

0

You can do it like this.

function formatDate(d: Date): string {

  let lang: string;
  if (navigator.languages != undefined) {
    lang = navigator.languages[0]; 
  } else {
    lang = navigator.language;
  }

  const options: DateTimeFormatOptions = {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
  };

  return new Intl.DateTimeFormat(lang, options).format(d);
}
    
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!