API reference

Current time

The current instant from the server clock, in one or more time zones.

GETPOST/api/time/nowMCP tool time_now

Returns the current time from the server's clock when the request is processed (millisecond resolution) as UTC, Unix seconds and milliseconds, and, for each requested zone, the local ISO 8601 time with offset, weekday, ISO week, day of year, zone abbreviation, UTC offset and whether DST is in effect. Use it instead of guessing today's date.

Browser version (runs locally): Time & Time Zones.

Try it

Credentials
Remember these credentials

Not saved: you will paste them again next time.

No credentials yet? Get a client ID and secret. They are sent only to this site, in an Authorization: Basic header.

POST /api/time/now with a JSON body

Parameters

ParameterTypeDefaultDescription
zoneslist of stringsUTCComma-separated (or JSON array) zones: IANA names (America/New_York, Europe/Paris, Asia/Tokyo), UTC, or fixed offsets (+05:30, UTC-03:00). Abbreviations like PST or CET are rejected as ambiguous. At most 20.
formatslist of rfc2822 | http | sql | iso_basic | iso_week_date | iso_ordinal | human—Extra renderings added to each zone's formatted map: rfc2822 (Tue, 13 Oct 2026 14:30:00 +0200), http (HTTP-date, always GMT), sql (2026-10-13 14:30:00.000 +02:00), iso_basic (20261013T143000+0200), iso_week_date (2026-W42-2), iso_ordinal (2026-286), human (Tuesday, October 13, 2026 at 2:30:00 PM GMT+2).
patternstring (≤ 100 chars)—Custom format using Luxon tokens (e.g. yyyy-MM-dd HH:mm ZZZZ; quote literal text in single quotes). Added to formatted.pattern. English names.

Also accepted on every endpoint: format (json | text). Parameters may come from the query string, a JSON object body, an urlencoded or multipart form, or (for input) a text/plain body.

Global parameters
ParameterTypeDefaultDescription
formatjson | textjsonjson returns the documented object. text returns only the primary value as text/plain (see "Text output").

Response 200 application/json

FieldTypeDescription
instantobject
instant.utcstringThe instant in UTC, ISO 8601 with Z.
instant.unix_secondsintegerWhole seconds since 1970-01-01T00:00:00Z, rounded down (floor).
instant.unix_millisecondsintegerMilliseconds since 1970-01-01T00:00:00Z.
zonesarray of objectOne entry per requested zone, in request order.
zones[].zonestringZone name as resolved: IANA name (letter case corrected), UTC, or UTC±HH:MM.
zones[].isostringISO 8601 / RFC 3339 with the UTC offset (Z for UTC). Milliseconds appear only when non-zero.
zones[].localstringWall-clock date-time in the zone without an offset, YYYY-MM-DDTHH:mm:ss[.SSS].
zones[].datestringLocal calendar date, YYYY-MM-DD.
zones[].timestringLocal time, HH:mm:ss (24-hour), with .SSS only when milliseconds are non-zero.
zones[].offsetstringUTC offset, ±HH:MM.
zones[].offset_minutesintegerUTC offset in minutes (east positive), e.g. -240 for UTC-04:00.
zones[].abbreviationstringShort zone name as Intl (en-US) prints it: EDT, PST, or GMT+2 where English has no common abbreviation.
zones[].offset_namestringLong zone name, e.g. Eastern Daylight Time.
zones[].dstbooleanTrue when daylight saving time is in effect at this instant.
zones[].weekdaystringEnglish weekday name, e.g. Tuesday.
zones[].weekday_numberintegerISO 8601 weekday: 1 = Monday … 7 = Sunday.
zones[].iso_weekstringISO 8601 week, YYYY-Www (the week-numbering year can differ from the calendar year near 1 January).
zones[].iso_week_yearintegerISO 8601 week-numbering year.
zones[].iso_week_numberintegerISO 8601 week number, 1-53.
zones[].day_of_yearintegerOrdinal day of the year, 1-366.
zones[].formattedmap of stringExtra renderings requested with formats (keyed by format name) and pattern (key pattern). Empty when none were requested.
warningsarray of stringWarnings about the zones given (fixed offsets, legacy or inverted names).

Text output (format=text, text/plain): The ISO 8601 time in each requested zone, one per line.

Errors

Errors are JSON: {"error": "<message>", "code": "<code>", "param": "<name>"?}.

StatusCodeWhen
400invalid_parameterA zone is unknown, an abbreviation, or local.
400missing_parameterA required parameter is absent.
400unknown_parameterA parameter name is not in the table above (typos are rejected, not ignored).
413payload_too_largeThe request body exceeds 1 MiB.
405method_not_allowedA method other than GET, POST or OPTIONS.

Behaviour

  • Not idempotent: the result can differ between calls (time, randomness, or a live network check).
  • Requires a client ID and secret (authentication). Each call is recorded as one metadata row against your client ID; inputs and outputs are never stored or logged. Responses carry cache-control: no-store.
  • CORS: any origin may call this endpoint from a browser, using your credentials.

Examples

Responses below were produced by running each request through this code at build time. Long strings are shortened.

Now in UTC

curl 'https://util.caruana.me/api/time/now?'

Response 200

{
  "instant": {
    "utc": "2026-10-26T02:47:35.337Z",
    "unix_seconds": 1792982855,
    "unix_milliseconds": 1792982855337
  },
  "zones": [
    {
      "zone": "UTC",
      "iso": "2026-10-26T02:47:35.337Z",
      "local": "2026-10-26T02:47:35.337",
      "date": "2026-10-26",
      "time": "02:47:35.337",
      "offset": "+00:00",
      "offset_minutes": 0,
      "abbreviation": "UTC",
      "offset_name": "UTC",
      "dst": false,
      "weekday": "Monday",
      "weekday_number": 1,
      "iso_week": "2026-W44",
      "iso_week_year": 2026,
      "iso_week_number": 44,
      "day_of_year": 299,
      "formatted": {}
    }
  ],
  "warnings": []
}
Same call as an MCP tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "time_now",
    "arguments": {}
  }
}

Now in several zones, with RFC 2822

curl 'https://util.caruana.me/api/time/now?zones=UTC%2CAmerica%2FNew_York%2CAsia%2FKolkata&formats=rfc2822'

Response 200

{
  "instant": {
    "utc": "2026-10-26T02:47:35.340Z",
    "unix_seconds": 1792982855,
    "unix_milliseconds": 1792982855340
  },
  "zones": [
    {
      "zone": "UTC",
      "iso": "2026-10-26T02:47:35.340Z",
      "local": "2026-10-26T02:47:35.340",
      "date": "2026-10-26",
      "time": "02:47:35.340",
      "offset": "+00:00",
      "offset_minutes": 0,
      "abbreviation": "UTC",
      "offset_name": "UTC",
      "dst": false,
      "weekday": "Monday",
      "weekday_number": 1,
      "iso_week": "2026-W44",
      "iso_week_year": 2026,
      "iso_week_number": 44,
      "day_of_year": 299,
      "formatted": {
        "rfc2822": "Mon, 26 Oct 2026 02:47:35 +0000"
      }
    },
    {
      "zone": "America/New_York",
      "iso": "2026-10-25T22:47:35.340-04:00",
      "local": "2026-10-25T22:47:35.340",
      "date": "2026-10-25",
      "time": "22:47:35.340",
      "offset": "-04:00",
      "offset_minutes": -240,
      "abbreviation": "EDT",
      "offset_name": "Eastern Daylight Time",
      "dst": true,
      "weekday": "Sunday",
      "weekday_number": 7,
      "iso_week": "2026-W43",
      "iso_week_year": 2026,
      "iso_week_number": 43,
      "day_of_year": 298,
      "formatted": {
        "rfc2822": "Sun, 25 Oct 2026 22:47:35 -0400"
      }
    },
    {
      "zone": "Asia/Kolkata",
      "iso": "2026-10-26T08:17:35.340+05:30",
      "local": "2026-10-26T08:17:35.340",
      "date": "2026-10-26",
      "time": "08:17:35.340",
      "offset": "+05:30",
      "offset_minutes": 330,
      "abbreviation": "GMT+5:30",
      "offset_name": "India Standard Time",
      "dst": false,
      "weekday": "Monday",
      "weekday_number": 1,
      "iso_week": "2026-W44",
      "iso_week_year": 2026,
      "iso_week_number": 44,
      "day_of_year": 299,
      "formatted": {
        "rfc2822": "Mon, 26 Oct 2026 08:17:35 +0530"
      }
    }
  ],
  "warnings": []
}
Same call as an MCP tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "time_now",
    "arguments": {
      "zones": [
        "UTC",
        "America/New_York",
        "Asia/Kolkata"
      ],
      "formats": [
        "rfc2822"
      ]
    }
  }
}