8000 GitHub - birukbelihu/TimeServer: A Simple Flask Time API To Get Realtime Time Information Without Any Third Party API
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

birukbelihu/TimeServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Repo stars GitHub forks GitHub issues GitHub license

Time Server

A Simple Flask Time API to get real-time time information without any third-party API.


Features

  • Highly Customizable
  • Get Comprehensive List Of Time Data Such As:
    • Milliseconds
    • Seconds
    • Minutes
    • Hour
    • Day
    • Month
    • Year
    • Date & Many More
  • Supports 500+ World Time Zones
  • Can be easily integrated with Android, Web, or any project via a simple HTTP request.

Usage

TimeServer Is Live On Render

TimeServer

Running

To get started with Time Server on your local machine, follow these steps:

Make sure you have Git and Python installed:

git --version
python --version

Clone The Repository

git clone https://github.com/BirukBelihu/TimeServer.git

Go Inside The Project

cd TimeServer

Install Required Dependencies

pip install -r requirements.txt

Start The Time Server

python main.py

If You're Calling The API From External Clients(Android Or Web) Don't Forget To Expose The Port Using Ngrok.

ngrok http 5000

N.B Replace 5000 With Your Own PORT If You're Using Different Port Number.

Sample Request Using cURL

curl http://IP_ADDRESS:PORT/api/v1/time/current/zone?timeZone=Africa/Addis_Ababa

Response

{
  "date": "03/04/2025",
  "dateTime": "2025-04-03T19:52:05.599935+03:00",
  "day": 3,
  "dayOfWeek": "Thursday",
  "dstActive": false,
  "hour": 19,
  "milliSeconds": 599,
  "minute": 52,
  "month": 4,
  "seconds": 5,
  "time": "19:52",
  "timeZone": "Africa/Addis_Ababa",
  "year": 2025
}

Get All The Available Time Zones

curl http://IP_ADDRESS:PORT/api/v1/time/current/zone/timeZones

Response

[
    "Africa/Abidjan",
    "Africa/Accra",
    "Africa/Addis_Ababa",
    "Africa/Algiers",
    "Africa/Asmara",
    "Africa/Asmera",
    "Africa/Bamako",
    "Africa/Bangui",
    "Africa/Banjul",
    ...
]

Get Server Status

 http://IP_ADDRESS:PORT/api/v1/status

Run Tests Using Pytest

pytest test_server.py

To Run TimeServer In Docker Container Follow This Steps.

Build Docker Image

docker build -t timeserver .

Run The Server

docker run -p 5000:5000 timeserver

The Rest Of The Steps Are Same

📢 Social Media

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.

About

A Simple Flask Time API To Get Realtime Time Information Without Any Third Party API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0