This repository contains a simple Node.js application that provides an API endpoint to retrieve current Unix timestamp and UTC time. Additionally, it allows users to pass a date string as a parameter to get the corresponding Unix timestamp and UTC time. The endpoint returns the timestamp data in the following JSON format:
{
"unix": 1707403038848,
"utc": "Thu, 08 Feb 2024 14:37:18 GMT"
}
-
Clone Repository:
git clone <repository_url>
-
Install Dependencies:
npm install
-
Run the Application:
npm start
-
Access the API:
- Navigate to http://localhost:3000/api to get the current Unix timestamp and UTC time.
- To get Unix timestamp and UTC time for a specific date, append the date in the format YYYY-MM-DD or Unix timestamp to http://localhost:3000/api/:date.
- Node.js
- Express.js