Substraction between dates

I see there are

static func + (lhs: Date, rhs: TimeInterval) -> Date
static func - (lhs: Date, rhs: TimeInterval) -> Date

But no

static func - (lhs: Date, rhs: Date) -> TimeInterval

Is this asymmetry intentional? Or shall I quickly contribute an MR?

2 Likes

I'd stay away from that minefield as far as I could :joy:
(see https://forums.swift.org/t/pitch-clock-instant-date-and-duration/ — no matter what you do, unexpected things will happen when performing date calculations)

1 Like