- Notifications
You must be signed in to change notification settings - Fork0
codeallyio/timestamp-microservice-fcc-solution
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- The API endpoint is
GET [project_url]/api/timestamp/:date_string?
- A date string is valid if can be successfully parsed by
new Date(date_string)
(JS) . Note that the Unix timestamp needs to be aninteger (not a string) specifyingmilliseconds. In our test we will use date strings compliant with ISO-8601 (e.g."2016-11-20"
) because this will ensure an UTC timestamp. - If the date string isempty it should be equivalent to trigger
new Date()
, i.e. the service uses the current timestamp. - If the date string isvalid 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"}
. - If the date string isinvalid the api returns a JSON having the structure
{"error" : "Invalid Date" }
.
- https://curse-arrow.hyperdev.space/api/timestamp/2015-12-15
- https://curse-arrow.hyperdev.space/api/timestamp/1450137600000
- {"unix":1451001600000, "utc":"Fri, 25 Dec 2015 00:00:00 GMT"}
About
No description, website, or topics provided.
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.