Hacker News new | ask | show | jobs
by henrikschroder 3809 days ago
By splitting the addition up into two discrete calls, the ordering is made much more explicit, there's no room for ambiguity.

In C#, the largest part of a TimeSpan is a day, you can't have a TimeSpan of "one month and one day", because adding that to a DateTime would add a different amount of absolute time depending on the DateTime. You can have a TimeSpan of "32 days", and adding that to any DateTime yields a consistent result.

1 comments

1h4m is 1 hr then 4 min. Order is explicit unless language rules obfuscate it.