Datetime-API/README.md

25 lines
871 B
Markdown
Raw Normal View History

2023-10-07 16:32:53 +02:00
# Datetime-API
As a fan of [TimeAPI.io](https://www.timeapi.io/swagger/index.html), 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](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
## Usage
```shell
neo@matrix:~$ curl -s -H "Accept: application/json" "http://localhost:9100/Time/current/zone?timeZone=Europe/Berlin" | jq
2023-10-07 16:32:53 +02:00
{
"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
}
```