View the source on GitHub or Glitch.
I created this app as a requirement for my freeCodeCamp APIs and Microservices Certification, using Node.js and Express. The above front end API test also uses Bootstrap, jQuery, and highlight.js. The API fulfills the following user stories:
GET [project_url]/api/timestamp/:date_string?
new Date(date_string)
.
"2016-11-20"
) because this will ensure an UTC
timestamp.
new Date()
, i.e. the service uses the current
timestamp.
{"unix": <date.getTime()>, "utc" :
<date.toUTCString()>}
e.g.
{"unix": 1479663089000, "utc": "Sun, 20 Nov 2016 17:31:29
GMT"}
{"error": "Invalid Date"}
.