Days from start to end date, inclusive.

I want to calculate the number of days a start date to an end date, inclusive. For example, Wed Jan 1st to Tues Jan 7th is 7 days when all dates are included.

I know that I can just compute the difference and add 1. But, I get this error message that is annoying me: "Duration units were removed."

Is there an elegant method to computing this?


I have considered accepting inputs for Wed Jan 1st to Wed Jan 8th, from the example above. It is technically still correct because the time component is 00:00 hrs. But, it makes it harder to communicate the date with others...

MacBook Air 13″, macOS 15.1

Posted on Dec 31, 2024 3:30 PM

Reply
2 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Days from start to end date, inclusive.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.