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

182
Vistas
Comparing two different dates using moment with existing date string?

Even the value I set for the time in the moment.js timezones same following two different approaches the value of the date returned is different

  1. moment("02:00","HH:mm").tz('America/Chicago').format()

returns 2022-03-31T15:30:00-05:00

  1. moment().tz('America/Chicago').set({hour:"02",minute:"00"})

returns 2022-04-01T02:00:02-05:00

And if I have a date string 2022-03-30T08:13:44.478+00:00 which I want to convert to specific time zones as below

moment(`2022-03-30T08:13:44.478+00:00`).tz('America/Chicago')

is it the right way if I want to compare it with the current date of that timezone?

moment(`2022-03-30T08:13:44.478+00:00`).tz('America/Chicago').isSameOrAfter(moment().tz('America/Chicago'))
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