Need feedback for FreeCodeCamp Timestamp Microservice Project

Tell us what’s happening:
I tried to make it without Moment JS and it’s working.

I think, I should add some RegExp and 404 route. But I don’t know RegExp yet.
Are there any bad practices in the code? Thank you!

Your code so far

app.get('/api/timestamp/:date', function(req, res) {
    // check, if entry is yyyy-mm--dd
    var data =;
    if (isNaN(data)) {
        // if entry is yy-mm-dd
        var unixFormat = new Date(data).getTime()/1000;
        var temp = new Date(unixFormat * 1000);
        var utc = temp.toUTCString();
    else {
        // if entry is unix time
        var temp = new Date(data * 1000);
        var utc = temp.toUTCString();
        var unixFormat = parseInt(data); // for removing quotation marks 
        unix: unixFormat,
        utc: utc

app.get('/api/timestamp', function(req, res) {
    // Now
    var time = new Date();
    var utc = time.toUTCString()
    var unix = time.getTime();
        unix: unix,
        utc: utc

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36.

Link to the challenge:

I reclassified your category to Project Feedback, since your are seeking feedback on your project.

Thank you! I am waiting for some feedbacks.