The Timestamp Microservice is a project from freeCodeCamp's Backend Development and APIs curriculum. It is designed to create a simple API that converts human-readable dates and UNIX timestamps, providing both formats as part of the response.
Features
- Timestamp Conversion:
- Accepts a date string or UNIX timestamp as a parameter
- Returns both the UNIX timestamp and the UTC date format
- Default Timestamp:
- When no date is provided, it returns the current timestamp (UNIX and UTC).
- Error Handling:
- Returns an error message for invalid date inputs.
How It Works
Input: A GET request with a date or timestamp parameter.
Output: A JSON response containing:
unix: The UNIX timestamp.
utc: The UTC date format.