My shot at Timestamp Microservice

You need to check the spec again:

Note that the unix timestamp needs to be an integer (not a string) specifying milliseconds.

Your endpoint is returning the timestamp as an integer/string (inconsistent depending on input) and parsed/given in seconds.

1 Like

Appreciate you pointing that out. I will need some help working on it I guess. I have hit a wall.

As your back-end is Node.js, you can just use the built-in Date.prototype methods.

Step 4 of the instructions states which methods to use:

If the date string is valid the api returns a JSON having the structure {"unix": <date.getTime()>, "utc": <date.toUTCString()>} e.g. {"unix": 1479663089000, "utc": "Sun, 20 Nov 2016 17:31:29 GMT"}.

1 Like