The title says it all. I'm subtracting two DateTimes and I want to see if the returned Timespan is negative. How do I do this?
// dt1 and dt2 are DateTimes.
TimeSpan ts = dt1.Subtract(dt2);
ts.isNegative() // or something like that
TimeSpan has a Compare method on it, or you can do < TimeSpan.Zero or you could have just compared the two DateTimes in the first place and skipped creating the TimeSpan entirely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With