apyhub
DEVELOPER TOOLS

Format Date API

What it does

Date Formatter takes an ISO datetime string and formats it with a Python strftime pattern. Send dt in the query string, optionally add fmt, and get back the original input, the format used, and the formatted result.

Use it when your app needs to present timestamps in a user-facing or integration-specific layout without reimplementing date formatting logic. It is useful for logs, dashboards, exports, emails, and any workflow where the same ISO datetime needs to appear in different local display formats.

The API is small and explicit: one datetime in, one formatted string out. If you omit fmt, the formatter uses %Y-%m-%d %H:%M:%S by default. That makes it easy to normalize date presentation across services while keeping the formatting rule in one place.

Because the response includes both the source value and the applied format, you can trace exactly how a timestamp was rendered and use the result directly in downstream systems.

GET
Format an ISO datetime string using a Python strftime pattern
http://localhost:8080/dosvak/date-format
QUICKSTARTGUIDE

Quickstart

Format a date/time by sending the required dt value as a query parameter.

curl -X GET "http://localhost:8080/dosvak/date-format?dt=2024-01-15T13:45:00Z" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with three string fields: input for the date/time you sent, format for the format used, and result for the formatted output.

{
  "input": "2024-01-15T13:45:00Z",
  "format": "%Y-%m-%d %H:%M:%S",
  "result": "2024-01-15 13:45:00"
}
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

Formats an ISO datetime string using a Python strftime pattern. It takes the input datetime and format string as query parameters, then returns a JSON object containing the original input, the format used, and the formatted result.

Query Parameter(s)

AttributeTypeMandatoryDescription
dtStringYesISO datetime string to format.
fmtStringNoPython strftime pattern. Default: %Y-%m-%d %H:%M:%S.

Response

Returns a JSON object with three string fields: input, format, and result. The response body reflects the input datetime and format used, along with the formatted output.

ParameterTypeMandatoryDescription
inputStringNoThe input datetime string.
formatStringNoThe format pattern used.
resultStringNoThe formatted datetime string.

Query parameters

Name
Type
Description
dtREQUIRED
string
fmtOPTIONAL
string
DEFAULT %Y-%m-%d %H:%M:%S
▣ 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.