DocsGet startedDates & calendars

Dates & calendars

The datetime format, timezones and exchange calendars.

Every date and time the API accepts or returns is a plain string in one of two forms. There is nothing else to learn — the same standard holds across the REST API and the MCP server, on input and on output.

The one standard

WhenFormatExample
A date is enoughYYYY-MM-DD2020-01-03
A time matters tooYYYY-MM-DD HH:MM:SS2020-01-03 16:00:00

Which form you get for a given field depends only on whether the time-of-day is meaningful for that field — an API key's created_at is a date, an index value's time is a full timestamp. Both forms are UTC. The string never carries a timezone designator: there is no T separator, no trailing Z, and no +00:00 offset. The date and the time are separated by a single space.

Input is lenient; output is canonical

On the way out you always get exactly the two forms above. On the way in the API is forgiving — it also accepts an ISO T separator and a trailing Z (2020-01-03T00:00:00Z) and normalises them for you — but emit the plain space-separated form and you never have to think about it.

The one parsing gotcha

Because a timestamp carries no timezone designator, a parser that assumes a bare timestamp is local time will silently shift every point in your series by your machine's offset. Treat the string as UTC when you parse it.

`new Date("2020-01-03 16:00:00")` is parsed as local time

Most JavaScript engines read a bare, designator-less timestamp as local time, not UTC. Rewrite it to an explicit-UTC ISO string first — swap the space for T and append a Z — before handing it to Date. In Python, datetime.fromisoformat parses both forms directly; attach tzinfo=timezone.utc yourself.
from datetime import datetime, timezone
def parse_time(value: str) -> datetime:
"""Parse an Index One date or datetime as an aware UTC datetime."""
# fromisoformat handles both "YYYY-MM-DD" and "YYYY-MM-DD HH:MM:SS".
parsed = datetime.fromisoformat(value.strip())
return parsed.replace(tzinfo=timezone.utc)

Timezones live on the index, not the timestamp

Serialised timestamps are UTC. The local context of an index — the timezone its close happens in — is configuration, held in index_parameters.

FieldFormatExample
timezoneIANA timezone nameUS/Eastern
eod_timeHH:MM:SS, local to timezone16:00:00
exchange_calendarMIC codeXNYS, XLON

eod_time is a wall-clock time in the index's own timezone, which means the corresponding UTC instant moves twice a year with daylight saving. An index closing at 16:00:00 US/Eastern closes at 20:00 UTC while daylight time is in force and 21:00 UTC the rest of the year. Never precompute a fixed UTC close time and cache it across a DST boundary.

Exchange calendars

An exchange_calendar is a MIC code identifying a real trading calendar — XNYS for the New York Stock Exchange, XLON for London. It defines which days are sessions, which are holidays, and when each session opens and closes, including half days.

This is what makes "the previous trading day" a well-defined idea. Without a calendar, a schedule can only speak in calendar days and will happily fire on Christmas Day or the Monday of a bank holiday.

Trigger alignment

Trigger operations snap a schedule to the session grid of a calendar. Five parameters control it.

ParameterMeaning
alignment_enabledTurn calendar alignment on — without it, the schedule is plain calendar time
align_timeThe reference time the alignment is computed against
trading_calendarWhich MIC calendar to align to
trading_daypreceding or following — which side to snap to when the target is not a session
session_timeclose or open — which end of the session to use

A typical daily configuration aligns to the preceding trading day at close on XNYS. That gives a run a stable, unambiguous "as of" point: the last completed session, whatever holidays intervened.

Alignment is evaluated in local time

Session lookups resolve against the calendar's local date, not the UTC date of the fire time. For a calendar whose local date differs from the UTC date at the moment the schedule fires — a London index around midnight during BST, for example — resolving on the UTC date picks the wrong session and the run lands one session early. If you are configuring a trigger near a local midnight, verify which session it actually selects.

Close + 15, stamped at the close

Live EOD does not run at the closing bell. It fires at close + 15 minutes, because closing quotes take time to settle and a value computed the instant the bell rings is computed against prices that are still moving.

The value it writes is nevertheless stamped at the close time, not at the time the calculation ran. So an index closing at 16:00:00 local produces a point timestamped 16:00:00, written around 16:15:00 local.

What this means for consumers

A point's timestamp is the session it belongs to, not the moment it became available. Polling for today's close at exactly the close time will find nothing — allow the settle window. And do not infer freshness from the timestamp: it deliberately understates when the data was written.