Metadata / Reference
alerta.timestamp
TradingView-compatible spelling: timestamp, runs without warnings
Builds a timestamp (milliseconds since the Unix epoch). Three forms: from date/time components, read on the chart symbol's exchange clock (`syminfo.timezone` — UTC on crypto charts, New York time on a US stock); with an IANA timezone as the first argument, which reads those components in that zone instead; or from a single DATE STRING — `timestamp("2024-01-01")`, `timestamp("2024-01-01 09:30")`, `timestamp("2026-08-01T11:00:00-0500")`. A date string without its own offset is read as UTC.
alerta.timestamp(year, month, day, hour, minute, second) | timestamp(timezone, year, month, day, …) | timestamp(dateString) → intParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
year | int or string | Yes | — | Year — or, in the other two forms, an IANA timezone followed by the date components, or a whole date string on its own. |
month | int | No | — | Month 1..12. Omitted in the date-string form. |
day | int | No | — | Day of month. Omitted in the date-string form. |
hour | int | No | — | Hour. |
minute | int | No | — | Minute. |
second | int | No | — | Second. |
Returns
intExample
alerta.timestamp
t = timestamp(2026, 4, 10, 12, 0, 0)fromText = timestamp("2026-04-10 12:00")plot(t == fromText ? 1 : 0, { title: "same instant", pane: "oscillator" })Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.