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

118
Views
Guessing Date Formats in Javascript

How would you approach date time guessing in javascript? Assuming the array provided would not contain conflicting formats.

const dateStringArr1 = ["2022-01-19 23:01:29+12", "2022-12-10 12:00:40+12"];
const dateStringArr2 = ["2022-13-01 23:01:29+12", "2022-20-09 12:00:40+12"];

// ref: https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
guessDateFormats(dateStringArr1);
// returns [
//   {
//     confidence: 100,
//     format: "yyyy-MM-dd HH:mm:ssx",
//   }
// ];

guessDateFormats(dateStringArr2);
// returns [
//   {
//     confidence: 100,
//     format: "yyyy-dd-MM HH:mm:ssx",
//   }
// ];
about 4 years ago · Santiago Gelvez
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!