I have used NodaTime with c# a lot, and it has been fantastic, but was caught out when trying to obtain the total minutes between two LocalDateTimes. My two times are more than a week apart.
This does not deliver a valid result: (1)
long Mns = Period.Between(nowLdt,triggerLdt).Ticks.ToSeconds() / 60;
This does deliver the correct result: (2)
double Mns = Period.Between(nowLdt,triggerLdt).ToDuration().ToTimeSpan().TotalMinutes;
So my question really is 3 questions:
Why does NodaTime not have a TotalMinutes function?
Why does (1) above not work?
Is there a cleaner way to do this than (2)?