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

138
Views
Can't be parsed as format error from Luxon

I have a date 02/03/2022 0600 I'm trying to make a Luxon object like so

DateTime.fromFormat(`${date} ${time}`, 'MM/dd/yyy HHmm'), this results in an error the input "02/03/2022 0600" can't be parsed as format MM/dd/yyy hhmm

It works fine with dates and times separately with the same format. Is Luxon unable to parse dates and times together in this way?

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

0

you have missed a y in 'MM/dd/yyy HHmm'. Change it to 'MM/dd/yyyy HHmm'

let a = luxon.DateTime.fromFormat('02/03/2022 0600', 'MM/dd/yyyy HHmm')
 
 console.log(a)
 
 console.log(Object.entries(a))
.as-console-wrapper { max-height: 100% !important; top: 0; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/luxon/2.3.0/luxon.min.js"></script>

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!