A basic TimeAPI.io clone.
Go to file
Andreas Schulte 6abf017209 revert 16eaba69c4
revert git.0x0001f346.de/andreas/api integration
2023-10-23 23:45:23 +02:00
LICENSE initial commit 2023-10-07 16:32:53 +02:00
README.md revert 16eaba69c4 2023-10-23 23:45:23 +02:00
go.mod initial commit 2023-10-07 16:32:53 +02:00
main.go revert 16eaba69c4 2023-10-23 23:45:23 +02:00

README.md

Datetime-API

As a fan of TimeAPI.io, but not third party providers in general, I wanted my self-hosted alternative. Basically, with this project I just wanted to create a very simple API that gives me a JSON object with many useful datetime values for a given timezone. The timezone has to be specified in IANA timezone format.

Usage

neo@matrix:~$ curl -s -H "Accept: application/json" "http://localhost:9100/Europe/Berlin" | jq
{
  "year": 2023,
  "month": 6,
  "day": 13,
  "hour": 13,
  "minute": 37,
  "seconds": 00,
  "milliSeconds": 000,
  "dateTime": "2023-06-13T13:37:00+02:00",
  "date": "06/13/2023",
  "time": "13:37",
  "timeZone": "Europe/Berlin",
  "dayOfWeek": "Tuesday",
  "dstActive": true
}