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

145
Vistas
Javascript different dates between React and API in NextJS

I have a weird issue, I'm sending new Date() to API in NextJS. When I check the new Date() in React side, it shows the current local time.

But when I console.log() the request in API side, it doesn't show the local date I'm sending, instead it shows minus 3 by hours. For example, below code

// Sending from React via POST
send({currentTime: new Date()}) // console logs 23:30:30

//API console log
console.log(req.body.currentTime) // console logs 20:30:30

My timezone is UTC+3, so API side doesn't take the time I'm sending and seems like somehow it changes it to the UTC-0 time zone.

Why it doesn't get the local time I'm sending?

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