Timestamp Microservice - "handle an empty date parameter"

I’ve completed all the task except for the empty parameter.

Here is my code:

app.get("/api/timestamp/", (req, res) => {
const date = new Date();


app.get("/api/timestamp/", (req, res) => {
unix: Date.now(),
utc: Date() })

I tried both method above but still doesn’t work.

Here’s the rest of the code:

// this tasks is complete
app.get("/api/timestamp/:date_slug", (req, res) => {
const { date_slug } = req.params;
const date = new Date(date_slug);
const timeStamp = Number(date_slug)
const timeStampToDate = new Date(timeStamp)

if(timeStampToDate.toUTCString() !== “Invalid Date”){
return res.json({

if (date.toUTCString() === “Invalid Date”) {
return res.json({
error: “Invalid Date”
} else {
unix: date.getTime(),
utc: date.toUTCString()


// running tests
It should handle an empty date parameter, and return the current time in unix format
It should handle an empty date parameter, and return the current time in UTC format
// tests completed

Link to the challenge:

In the challenge example my code works the same but fcc still yells at me please help.

Hello there,

For future reference, when you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

As for your question, I suggest you take a look at the tests, as they will provide insight as to what you are expected to return.

We are aware of a few issues with the backend projects instructions not being up-to-date with the tests.

Here are the tests: https://github.com/freeCodeCamp/freeCodeCamp/blob/master/curriculum/challenges/english/05-apis-and-microservices/apis-and-microservices-projects/timestamp-microservice.english.md

Hope this helps

Thank you for the advice this is my first time posting on this forum and the editor is like the markdown previewer project that i build in the front end curriculum but really don’t know how this works.
I will check the link you gave me thank you again.