timestamp
Assembles a time from its parts - the other direction from the eight functions that take a time apart.
The parts are read as a wall-clock time in the exchange’s own timezone, and the result is milliseconds from the Unix epoch, matching time and timenow.
Two forms. Pass series arguments and you get a series int; pass simple arguments and you get a simple int. In both forms the year, the month and the day are required, and the hour, the minute and the second may be left out, each defaulting to zero.
timestamp(series int year, series int month, series int day, series int hour, series int minute, series int second) → series inttimestamp(simple int year, simple int month, simple int day, simple int hour, simple int minute, simple int second) → simple int| Parameter | Type | Required | Description |
|---|---|---|---|
year | series int | yes | The year. Required. |
month | series int | yes | The month. Required. |
day | series int | yes | The day of the month. Required. |
hour | series int | no | The hour. Optional. |
minute | series int | no | The minute. Optional. |
second | series int | no | The second. Optional. |
Returns series int or simple int — An int in the form the arguments were passed in - series int for the series form, simple int for the simple form - counting milliseconds from the Unix epoch.
indicator("A time built from its parts")
plot(timestamp(2024, 1, 1))See also sessions and intervals
Part of the function index.