public static operator+(dt as DateTime, duration as Duration) as DateTime:
Adds a duration to this DateTime object.
| Parameter | Description |
|---|---|
dt | The DateTime object. |
duration | The duration to add. |
A new DateTime object with the duration added.
import klyn.time dateTime = DateTime(year=2023, month=10, day=5, hour=14, minute=30, second=45) duration = Duration(seconds=3600) newDateTime = dateTime + duration print(newDateTime.toString()) # Output: 2023-10-05 15:30:45