Skip to content
Algo Trade Analytics Docs

input.time() - Pine Script Function

Adds two inputs to the script’s “Settings/Inputs” tab on the same line: one for the date and one for the time. The user can change the price in the settings or by selecting the indicator and dragging the price line. The function returns a date/time value in UNIX format.

input.time(defval, title, tooltip, inline, group, confirm, display, active) → input int
NameTypeDescription
defvalconst intDetermines the default value of the input variable proposed in the script’s “Settings/Inputs” tab
fromwhere the user can change it. The value can be a timestamp function
butonly if it uses a date argument in const string format.

Value of input variable.

  • The user can change the input’s value by specifying a new value in the “Settings/Inputs” tab, or by moving the input’s marker on the chart. Alternatively, they can select “Reset points” from the script’s “More” menu and set a new input value by clicking a point on the chart.
//@version=6
indicator("input.time", overlay=true)
i_date = input.time(timestamp("20 Jul 2021 00:00 +0300"), "Date")l =
label.new(i_date, high, "Date", xloc=xloc.bar_time)label.delete(l[1])