ConstOperator / Temporal Layer
Perform addition or subtraction of constant duration values to datetime columns, similar to pandas timedelta operations or SQL DATEADD().
Example operations:
Input DateTime | Operation | Duration | Result DateTime | Note |
---|---|---|---|---|
2024-01-15 12:00:00 | Add | 1d12h | 2024-01-17 00:00:00 | Forward time |
2024-01-15 12:00:00 | Sub | 2w | 2024-01-01 12:00:00 | Backward time |
2024-01-31 12:00:00 | Add | 1mo | 2024-02-29 12:00:00 | Month aware |
Duration units:
- ns: Nanoseconds (1/1,000,000,000 second)
- us: Microseconds (1/1,000,000 second)
- ms: Milliseconds (1/1,000 second)
- s: Seconds
- m: Minutes
- h: Hours
- d: Days
- w: Weeks
- mo: Months
- q: Quarters
- y: Years
- i: Index positions
Common applications:
- Date shifting
- Deadline calculation
- Schedule planning
- Period analysis
- Event scheduling
- Time window operations
Table
0
0
Table
Select
columnDateTime column to modify. Operation preserves time components and handles:
- Month length variations
- Leap years
- Timezone transitions
Operator
enumArithmetic operation to perform with the duration constant.
Add ~ Sub ~
Add duration to move forward in time. Examples:
- Add 1d: Tomorrow same time
- Add 1mo: Next month same day
- Add 1y: Next year same date
Subtract duration to move backward in time. Examples:
- Sub 1d: Yesterday same time
- Sub 1mo: Previous month same day
- Sub 1y: Previous year same date
Value
stringDuration string specifying time delta. Format: combination of quantity and unit. Examples:
- '1d': One day
- '2h30m': Two hours thirty minutes
- '1y6mo': One year six months
- '1w2d12h': One week two days twelve hours Units can be combined (1y2mo3d4h5m6s)
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.