Open TimeAPI

Open TimeAPI is a free & open source service alternative to timeapi.io to get realtime time information without any third party API.
Table of Contents
Features
- Multiple Unix timestamp formats: Get current time in seconds, milliseconds, microseconds, and nanoseconds
- UTC time: Retrieve current UTC time in RFC3339 format
- IANA timezone lookup: Get date/time, weekday, DST status, and UTC offset for any valid timezone
- Coordinate-based time lookup: Resolve current time from latitude and longitude
- IP-based time lookup: Get current time for an IP address or caller address
- Available timezones endpoint: List all supported IANA timezone names
- Swagger documentation: Built-in API docs available at
/swagger/
- Docker support: Containerized deployment for easy scaling
- Lightweight: Minimal dependencies for better performance
Tech Stack
- Backend:- Go
- Frontend:- HTML/CSS/JavaScript
- Deployment: Docker
Quickstart
Docker
The fastest way to get started:
docker run --rm -p 127.0.0.1:5000:5000 birukbelihu/open-timeapi:latest
Building from Source
Clone the repository and build it yourself:
git clone https://github.com/birukbelihu9/open-timeapi.git
cd open-timeapi
go build
./open-timeapi
The web app interface will be available at:
http://localhost:5000
API Documentation
Interactive Swagger documentation is available at:
http://localhost:5000/swagger/
Tip: When testing the ip or coordinate endpoints from a local environment wihout a query parameter, use a port forwarding tool like ngrok. Private loopback addresses like 127.0.0.1 and ::1 are not present in geo location databases, so the response will like this.
{
"error": "Timezone not found for the given ip address."
}
Reporting Issues
If you find a bug or have a feature request, please open an issue. Include as much detail as possible, such as steps to reproduce the issue.
License
This project is licensed under the Apache License 2.0. See LICENSE for details.