Back End Development and APIs Projects - Exercise Tracker

I was having problems localy with the test:

The response returned from POST /api/users/:_id/exercises will be the user object with the exercise fields added.

Because when date = ‘1990-01-01T00:00:00.000’ somehow the response was showing Sun Dec 31 1989, I had to manually set my system timezone to UTC 00:00 so it doesn’t change the dates.

Even when I use new Date(date).toLocaleDateString('en-Us', {timeZone: 'UTC'}) the respose was the day before.

Is there a way to fix this without changing my system timezone?

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.46

Challenge: Back End Development and APIs Projects - Exercise Tracker

Link to the challenge:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.