'How to get between old date and current date in pine script?

I am calculating the between dates flag like following in pine script:

start_day = input(title="Star Day", type=input.integer, defval=1, minval=1, maxval=31)
start_month = input(title="Star Month", type=input.integer, defval=1, minval=1, maxval=12)
start_year = input(title="Star Year", type=input.integer, defval=2022)

end_day = input(title="End Day", type=input.integer, defval=4, minval=1, maxval=31)
end_month = input(title="End Month", type=input.integer, defval=1, minval=1, maxval=12)
end_year = input(title="End Year", type=input.integer, defval=2022)

between_dates = (time >= timestamp(start_year, start_month, start_day, 7, 0) and (time >= timestamp(end_year, end_month, end_day, 29, 59)))

But I want to get current year, month and day values as integer.

Or is there a shortest way to get between dates flag? Using single input for dates?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source