apyhub
DEVELOPER TOOLS · GEOLOCATION

Convert Date & Time Formats API

What it does

Date Time Converter turns a single timestamp into the formats developers actually use. Send an ISO 8601 value, a unix epoch, or now, optionally include an IANA timezone, and get back normalized UTC time, human-readable output, relative time, and localized details.

The response includes the original input, iso_utc, weekday, iso_week, relative, human_utc, day_of_year, epoch_millis, and epoch_seconds. When you pass tz, the localized object returns the timezone name, localized ISO string, localized human-readable string, and UTC offset. That makes it useful for log viewers, scheduling interfaces, analytics dashboards, and any system that needs to present the same moment in both machine-friendly and user-friendly forms.

Use Date Time Converter when you need to parse incoming event times, display timestamps in a user's timezone, or compare stored values across systems that disagree on time format. It is a straightforward way to convert one date-time value into multiple representations without rebuilding the logic in your application.

POST
Convert epoch/ISO time to many formats + timezone + relative time.
http://localhost:8080/creightonnick0/convert-date-time
QUICKSTARTGUIDE

Quickstart

Convert an ISO 8601 date/time into UTC and a localized timezone format.

curl -X POST "http://localhost:8080/creightonnick0/convert-date-time" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tz": "America/New_York",
    "value": "2026-08-02T12:00:00Z"
  }'

What you'll get back

Returns a JSON object with fields for the converted date/time in UTC and the requested timezone, plus useful derived values like weekday, ISO week, relative time, and epoch timestamps.

Top-level fields include input (string), iso_utc (string), weekday (string), iso_week (integer), relative (string), human_utc (string), localized (object with tz, iso, human, and utc_offset), day_of_year (integer), epoch_millis (integer), and epoch_seconds (integer).

{
  "input": "2026-08-02T12:00:00Z",
  "iso_utc": "2026-08-02T12:00:00.000Z",
  "weekday": "Sunday",
  "iso_week": 31,
  "relative": "in 6 months",
  "human_utc": "Sun, 02 Aug 2026 12:00:00 GMT",
  "localized": {
    "tz": "America/New_York",
    "iso": "2026-08-02T08:00:00.000-04:00",
    "human": "Sun, 02 Aug 2026 08:00:00 GMT-4",
    "utc_offset": "-04:00"
  },
  "day_of_year": 215,
  "epoch_millis": 1785672000000,
  "epoch_seconds": 1785672000
}
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.
body
IANA timezone for localized output
ISO 8601 string, unix epoch, or now

About this endpoint

What it does

Converts a date/time input into multiple output formats, including UTC representations, relative time, localized time for a provided timezone, and epoch values. The request accepts a date/time value and an IANA timezone tz for localized output.

Request Body

ParameterTypeMandatoryDescription
tzStringNoIANA timezone for localized output.
valueStringNoDate/time input as an ISO 8601 string, Unix epoch, or now.

Response

Returns a JSON object with these fields: input string, iso_utc string, weekday string, iso_week integer, relative string, human_utc string, localized object, day_of_year integer, epoch_millis integer, and epoch_seconds integer. The localized object contains tz string, iso string, human string, and utc_offset string.

ParameterTypeMandatoryDescription
inputStringNoOriginal input value as returned by the service.
iso_utcStringNoUTC timestamp in ISO format.
weekdayStringNoWeekday name for the converted date/time.
iso_weekIntegerNoISO week number.
relativeStringNoRelative time description.
human_utcStringNoHuman-readable UTC format.
localizedObjectNoLocalized date/time details for the requested timezone.
day_of_yearIntegerNoDay number within the year.
epoch_millisIntegerNoUnix epoch in milliseconds.
epoch_secondsIntegerNoUnix epoch in seconds.

Body

Name
Type
Description
bodyOPTIONAL
object
▣ 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.