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

189
Vistas
Timezone specific date error in luxon javascript

I am using luxon for generating timezone specific dates.

Here are the outputs I am getting

startStr 2021-11-14 12:00:00 am
startTimeObj 2021-11-13T18:00:00.000Z
endStr 2021-11-14 08:00:00 am
endTimeObj 2021-11-14T14:00:00.000Z

Here is my code to convert the dates

return DateTime.fromFormat(startStr, 'yyyy-MM-dd tt', {zone: 'Asia/Dhaka', setZone: true}).toJSDate();

for startStr it is working properly. As the timezone provided is 6hours ahead it is showing 18:00:00.

But for endStr it is giving wrong output. I am guessing it is ignoring am/pm. Because the output should have been T02:00:00 but instead its showing T14:00

interestingly, it works perfectly in my local mac device. Getting wrong values in the server

about 4 years ago · Juan Pablo Isaza
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