Timestamp microservice works, but not passing tests

Hello,
I just finished Timestamp Microservices app, it seems working but it’s not passing the below tests:

  • A request to /api/1451001600000 should return { unix: 1451001600000, utc: “Fri, 25 Dec 2015 00:00:00 GMT” }

  • Your project can handle dates that can be successfully parsed by new Date(date_string)

Here’s my project link:
Replit - Timestamp Microservice

any advice or explanation is appreciated,
Thanks

Use the network tab in the browser and check the request and response when you submit.


The unix property has to be of type number.

Request URL:
https://boilerplate-project-timestamp.qalkaraimeh.repl.co/api/2016-12-25

Response:

{"unix":1482624000000,"utc":"Sun, 25 Dec 2016 00:00:00 GMT"}

Request URL:
https://boilerplate-project-timestamp.qalkaraimeh.repl.co/api/1451001600000

Response:

{"unix":"1451001600000","utc":"Fri, 25 Dec 2015 00:00:00 GMT"}

Your code should handle the param 05 October 2011, GMT

Request URL:
https://boilerplate-project-timestamp.qalkaraimeh.repl.co/api/05%20October%202011,%20GMT

Response:

{"unix":"05 October 2011, GMT","utc":"Thu, 01 Jan 1970 00:00:00 GMT"}
1 Like

Thanks for the explanation , it helped

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