Calculates the duration of a time interval between two dates (datetimes/timestamps).
since
or until
in parameters below).
If only one column is provided as input, one of since
or until
must be specified as a reference date.
Examples
ds.first_name
), datasets (ds
or ds[["first_name", "last_name"]]
) or models (referenced
by name e.g. "churn-clf"
).
Inputs
Outputs
step(..., {"param": "value", ...}) -> (output)
.
Parameters
Y
year
Year
years
Years
Q
quarter
Quarter
quarters
Quarters
M
month
Month
months
Months
W
week
Week
weeks
Weeks
D
day
Day
days
Days
h
hour
Hour
hours
Hours
m
minute
Minute
minutes
Minutes
s
second
Second
seconds
Seconds
ms
millisecond
Millisecond
milliseconds
Milliseconds
date1
occurred before or after date2
.date1 - since
. I.e. intervals will be positive if dates in the column are more recent than the reference date (and negative otherwise). The date must be either a valid date string (preferrable month-first, e.g. “2021-12-31”), or the constant “now”.Options
until - date1
. I.e. intervals will be positive if the reference date is more recent than the dates in the column (and negative otherwise). The date must be either a valid date string (preferrable month-first, e.g. “2021-12-31”), or the constant “now”.Options