t2 = dateshift(t, 'start', unit)
t2 = dateshift(t, 'end', unit)
t2 = dateshift(t, 'start', unit, rule)
t2 = dateshift(t, 'dayofweek', day, rule)
| Parameter | Description |
|---|---|
| inputs | A datetime array, shift mode, unit or weekday selector, and optional rule. |
| Parameter | Description |
|---|---|
| output | A datetime array shifted according to the selected rule. |
Shift datetime values to calendar boundaries or selected weekdays.
Supported boundary units include year, quarter, month, week, day, hour, minute, and second. Weekday shifting accepts weekday names, numbers, weekday, and weekend.
Array-valued inputs keep their data shape when the operation supports arrays. Scalar operands are expanded where the implementation defines scalar expansion.
t = datetime(2024, 5, 17, 13, 14, 15)
dateshift(t, 'start', 'month')
dateshift(t, 'dayofweek', 'Monday', 'next')
| Version | Description |
|---|---|
| 2.0.0 | initial version |