View the source on GitHub or Glitch.
This is a Python/Flask port of my Node.js timestamp microservice project, which was originally built to fulfill 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"}
.