input.time() - Pine Script Function
input.time()
Section titled “input.time()”Overview
Section titled “Overview”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.
Syntax
Section titled “Syntax”input.time(defval, title, tooltip, inline, group, confirm, display, active) → input intParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| defval | const int | Determines the default value of the input variable proposed in the script’s “Settings/Inputs” tab |
| from | — | where the user can change it. The value can be a timestamp function |
| but | — | only if it uses a date argument in const string format. |
Returns
Section titled “Returns”Value of input variable.
Remarks
Section titled “Remarks”- 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.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("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])