4 ms·
That's not really always possible/practical. It's pretty common to say "in three months from now" in which case defining a month to be 31, 30, 29, or 28 days is
by slaymaker1907 5y ago
That's not really always possible/practical. It's pretty common to say "in three months from now" in which case defining a month to be 31, 30, 29, or 28 days is not correct. The plain English meaning is to be on the same day of the month, but add 3 to the month value, probably rounding down if necessary. Therefore, 3 months from January 31st 2021 would be April 30th despite going through February which has 28 days.
- travisjungroth 5y agoI think the point of the person you're replying to is to move the ambiguity onto the month object and off the plus operator. So today.plus(1 monthish) rather than today.plusish(1 month).
- chii 5y agobut this breaks down when the destination date is not within the calendar days of the month. For example, what is 3 months from Nov 30th? Should it be Feb 28th (or, if it's a leap year, should it have been 29th?), or should it be Mar 2nd?
- hcarvalhoalves 5y agoIt may be common and still completely ambiguous what “3 months from now” means — ask people around and you’ll get different answers. - Same calendar day plus 3 calendar month, round down if < end of month - Just plus 3 calendar month plus remaining days if > end of month - 90 days from now