An API and GUI React App for it to convert date time between javascript
- milliseconds timestamps and
- UTC date time string representation of it
Example:
- timestamp
1451001600000
and - date time string
Fri, 25 Dec 2015 00:00:00 GMT
call | response | response JSON format |
---|---|---|
/ |
run the React App (HTML) | not returned |
/api/ |
get the JSON of current time | {"unix":1690638937740,"utc":"Sat, 29 Jul 2023 13:55:37 GMT"} |
/api/1451001600000 |
get the Successful JSON of converted timestamp | {"unix":1451001600000,"utc":"Fri, 25 Dec 2015 00:00:00 GMT"} |
/api/Fri, 25 Dec 2015 00:00:00 GMT |
get the Successful JSON of converted date time string | {"unix":1451001600000,"utc":"Fri, 25 Dec 2015 00:00:00 GMT"} |
/api/invalid-date |
get the Error JSON | {"error":"Invalid Date"} |
https://timestamp-microservice-t7m9.onrender.com/ (Will take 30 seconds to spin up the inactive server)
Program | Download link | Note |
---|---|---|
Node.js | https://nodejs.org/en/download | Also installs npm package manager |
Git | https://git-scm.com/downloads | |
(Optional) pnpm | https://pnpm.io/installation | This is a different package manager used for reduced disk space when installing below packages. This is optional, the builtin npm will work too with below commands,Just replace pnpm with npm |
Step | Terminal commands | Notes |
---|---|---|
clone the repository or download it as ZIP file |
git clone https://github.com/new-AF/timestamp-microservice.git |
|
enter the directory of the now local repository | cd timestamp-microservice |
|
install the dependencies | pnpm install |
|
Run the backend server | pnpm exec server/server.js |
|
Run the frontend server and the React App | pnpm run dev |
|