public static operator-(left as DateTime, right as DateTime) as Duration:
Subtracts one DateTime object from another.
| Parameter | Description |
|---|---|
dt | The DateTime object to subtract from. |
dt2 | The DateTime object to subtract. |
The duration between the two DateTime objects.
import klyn.time dateTime1 = DateTime(year=2023, month=10, day=5, hour=15, minute=30, second=45) dateTime2 = DateTime(year=2023, month=10, day=5, hour=14, minute=30, second=45) duration = dateTime1 - dateTime2 print(duration.totalSeconds()) # Output: 3600