The date property of any object in the log array that is returned from GET /api/users/:_id/logs should be a string. Use the dateString format of the Date API

Hi Guys,

For those who are trying to pass Back End Development and APIs #4 Exercise Tracker.

If you are getting error “” The date property of any object in the log array that is returned from GET /api/users/:_id/logs should be a string. Use the dateString format of the Date API. “”.

  • Open dev tool on the freecodecamp page where you are running your test.
  • In the dev tool console open network
  • Do the test and find “logs” response headers. Check the date in the “logs” response headers.
access-control-allow-origin: *
content-length: 181
content-type: application/json; charset=utf-8
date: Tue, 16 Aug 2022 02:00:37 GMT
etag: W/"b5-Brj+8KR0j7ee1CnOnIA2Rhaafg8"
expect-ct: max-age=2592000
replit-cluster: global
x-powered-by: Express
  • Change the date on you pc or laptop to the date corresponding to logs “response” date.
  • Run test again
  • Test should pass
1 Like

Or you could modify your app’s logic to account for the timezone offset.

1 Like