An empty date parameter should return the current time in a JSON object with a unix key
An empty date parameter should return the current time in a JSON object with a utc key
However, if I go the appropriate url, I seem to get a valid response:
{"utc":"Wed, 11 Jan 2023 03:27:54 GMT","unix":1673407674220}
Would appreciate it if someone could point out what is wrong with this response.
Edit: I was able to get the tests to pass if I hardcoded the current unix time instead of using Date.now(). Obviously this isn’t a satisfying solution, but I’m still at a loss as to how Date.now() could be incorrect.
The relevant code is at the bottom of index.js. Both tests mentioned in the post fail, and I was able to get both to pass by replacing the call to Date.now() with a hardcoded number for the current unix time on line 33.
Your repl should pass. It does for me. It could be failing because your PC clock is a tiny bit out of sync. Try resyncing by going into your system Date and Time settings and finding the ‘sync’ option. Then, resubmit your repl link and see if it works.