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

143
Views
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
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!