Problem with date difference calculation

This is here on meta. First post dated Aug 25, next post, “2 months later” dated today. This is a PM. First post in thread also not 2 months ago.

1 Like

This was a recent change - the “x days/months/years” later used to round down, now it rounds up. Perhaps is should just “round”, instead of using floor or ceil.

cc @codinghorror @eviltrout


Would that even be 1.5 @eviltrout?

OH! I guess this is the end of September, which is > 1 month.

No, but since it does ceil > 1 month = 2 months. Seems like you want round.

Hmm the intent was for 1.0 - 1.499 to be “1 month” and 1.5 - 1.999 to be “2 months” @eviltrout.


I changed it to use round.