Back End Development and APIs Projects - Exercise Tracker

Tell us what’s happening:

Hey folks - I’m unable to pass Test 8. even after spending a significant amount of time double-checking types and formats. My output is virtually the same to the one in the example provided in the test page (at least on the surface), so my assumption is that I’m encountering the same UTC error that other users have reported.

Before I spend more time on this test, I’d like to ask - how can one check if the timezone/UTC difference is the issue at play here, or something else? If I know that this is the issue, I’m happy to spend time debugging it and looking for a solution, but right now I feel I’m going blind as whether that is the issue or not.

Any tips would be welcome. Please bear in mind none of the tests from 9-16 should pass, as I’m building functionality test-by-test and I’m stuck in 8.

Thanks,
Fernando

###Your project link(s)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0

Challenge Information:

Back End Development and APIs Projects - Exercise Tracker

Hi @palhares.f

You could console log new Date(), then compare the seconds to the system time on your computer to the virtual computer.

Then add or minus thousands of milliseconds as needed to synchronise the seconds. I managed to pass the Timestamp microservice project this way. Matching to the exact time did not work.

Happy coding

1 Like

The _id value type is not correct in the response. Compare the user id value in the user creation response, to the exercises id response type.

1 Like

Thank you for the suggestion - it turns out I was silly and failed to realize issue was with variable types, not timezones.

If someone else ends up in this post in the future and is unclear what to do with date, this is what I used (and worked):

  • Take the date from the form, or generate it with new Date();
  • Convert it to an UTC String using the appropriate method
  • Split it into sub-strings and re-arrange them until you have the desired format (which is slightly different from what comes straight from the UTC String method output)

Passing the rearrangedDate worked fine for me.

Best,

I swear I double and triple-checked variable types before posting my question here, but clearly I overlooked this. It feels really silly but I’m glad you were able to pinpoint it for me, I appreciate it @lasjorg

If anyone ends up here in the future - make sure you triple-check variable types. As far as I could tell, the only field in the JSON that is not a string is the duration field.

Best,