Datetime / Timespan Operators
General Form | Meaning / Remarks |
---|---|
dt + ts dt - ts |
adjust datetime by a timespan Results in a datetime value representing the starting datetime value plus or minus the elapsed amount of time. |
dt1 – dt2 |
difference between datetimes Results in a timespan value representing the length of time that's elapsed between the two datetime values. |
ts1 + ts2 |
sum timespans Results in a timespan value representing the total length of time. |
ts1 – ts2 |
difference between timespans Results in a timespan value representing the difference in the lengths of time. |
ts * n n * ts ts / n |
scale timespan by a number Results in a timespan value representing the expanded or compressed length of time. |
dt1 < dt2 ts1 < ts2 dt1 > dt2 ts1 > ts2 dt1 <= dt2 ts1 <= ts2 dt1 >= dt2 ts1 >= ts2 |
test for relative order Determines how one datetime value relates to another, or how one timespan value relates to another, resulting in a bool value. The result is true if the comparison is successful, otherwise it's false. |