open-timeapi

command module
v0.0.0-...-963f19e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

README

Open TimeAPI

GitHub stars GitHub forks GitHub issues License Go version

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL