Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

141
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda