ariebovenberg / whenever

⏰ Modern datetime library for Python
https://whenever.rtfd.io
MIT License
904 stars 15 forks source link

Support adding `days` to `Instant` #179

Open ariebovenberg opened 1 month ago

ariebovenberg commented 1 month ago

Instant currently doesn't support adding days because they're treated as "calendar days" in the rest of the library (which aren't always 24 hours due to DST). However, for Instant days can be assumed to always be 24 hours.

Implementing this needs to be weighed with the downside of muddying the water between "standard" days and "calendar" days

BurntSushi commented 1 month ago

Strong precedent here would be that Temporal doesn't support adding days (or higher) to an Instant.

filmor commented 1 month ago

As someone who just had to deal with people circumventing NodaTime 's intentionally missing Instant.PlusDays via Instant.Plus(Duration.FromDays(...)), I second Temporal's decision. Adding days to an Instant is one of those things that work well for almost all times and looks reasonable enough that it only really blows up on DST change days.