apyhub
Back
▣ GEOLOCATION · STANDARD DATA

Convert Timezone API

What it does

Timezone Convert converts a datetime string from one IANA timezone to another. Send dt, from_tz, and to_tz, and get back the original input alongside the converted result string.

Use it when your application needs to display or store the same moment in a different timezone without doing the conversion logic yourself. It fits scheduling tools, calendar workflows, booking systems, and any backend that needs to normalize timestamps across regions.

The API accepts only the three query fields defined in the schema, so it stays simple to integrate. dt is the datetime string you want to convert, from_tz is the source IANA timezone, and to_tz is the destination IANA timezone. The response returns input, from_tz, to_tz, and result so you can log the conversion or pass it through to the next step in your workflow.

If you work with international users, this gives you a lightweight way to keep timestamps consistent across timezones.

GET
Convert a datetime string between any two IANA timezones
https://api.eu.apyhub.com/dosvak/timezone-convert

QUICKSTART

GUIDE

Quickstart

Convert a date/time from one timezone to another by passing the required query parameters.

curl -X GET "https://api.eu.apyhub.com/dosvak/timezone-convert?dt=2024-01-15T10:00:00Z&from_tz=UTC&to_tz=America/New_York" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with input, to_tz, result, and from_tz string fields describing the conversion.

{
  "input": "2024-01-15T10:00:00Z",
  "to_tz": "America/New_York",
  "result": "2024-01-15T05:00:00-05:00",
  "from_tz": "UTC"
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Converts the provided datetime string from one IANA timezone to another and returns the original input plus the converted result.

Query Parameter(s)

AttributeTypeDescription
dtStringDatetime string to convert.
from_tzStringSource IANA timezone.
to_tzStringTarget IANA timezone.

Response

Returns a JSON object with input, to_tz, result, and from_tz string fields. The input field echoes the provided datetime string, from_tz and to_tz identify the source and target timezones, and result contains the converted datetime string.

ParameterTypeDescription
inputStringOriginal datetime string provided in the request.
to_tzStringTarget IANA timezone.
resultStringConverted datetime string.
from_tzStringSource IANA timezone.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.