Skip to content

Latest commit

 

History

History
118 lines (84 loc) · 4.1 KB

File metadata and controls

118 lines (84 loc) · 4.1 KB

OpenTimezone

Description

Maintainability Rating license .NET

OpenTimezone is an open source, free, public API that converts time between different time zones.

OpenTimezone provides:

Usage

Example 1: Convert time from New York to London.

 curl -X 'POST' \
    'https://api.opentimezone.com/convert' \
    -H 'Content-Type: application/json' \
    -d '{
    "dateTime": "2024-10-14T00:00:00.000",
    "fromTimezone": "America/New_York",
    "toTimezone": "Europe/London"
    }' 

Try it out


Example 2: Convert UTC to New York time.

curl -X 'POST' \
  'https://api.opentimezone.com/convert' \
  -H 'Content-Type: application/json' \
  -d '{
    "dateTime": "2025-09-17T04:36:48.131338",
    "fromTimezone": "UTC",
    "toTimezone": "America/New_York"
  }'

Try it out


Example 3: Convert New York to UTC time.

curl -X 'POST' \
  'https://api.opentimezone.com/convert' \
  -H 'Content-Type: application/json' \
  -d '{
    "dateTime": "2025-09-17T00:36:48.131394",
    "fromTimezone": "America/New_York",
    "toTimezone": "UTC"
  }'

Try it out


Example 4: List all supported time zones.

curl -X 'GET' 'https://api.opentimezone.com/timezones'

Try it out


Installation

Option 1: Using Docker (recommended for self-hosting)

Requirements

  • Docker.

How to Run

  1. From the root folder of the project, run the following commands:
    docker build -t opentimezone -f ./src/Timezone.WebApi/Dockerfile .
    docker run -it -p 5280:8080 opentimezone
  2. The API can be accessed at http://localhost:5280.

Option 2: Using Visual Studio (recommended for development purposes)

Requirements

  • Visual Studio 2026.
    • With ASP.NET and web development installed from the Visual Studio Installer.
  • Docker.
  • .NET 10 SDK.

How to Run

  1. Open the solution in Visual Studio 2026.
  2. Run it using Docker.
  3. The API can be accessed at https://localhost:5281.

How to Test

  1. Open the solution in Visual Studio 2026.
  2. Run the tests in Test Explorer.

Contributing

Pull requests are accepted.

License

MIT.