Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounding #152

Open
ariebovenberg opened this issue Jul 9, 2024 · 2 comments
Open

Rounding #152

ariebovenberg opened this issue Jul 9, 2024 · 2 comments
Assignees
Labels
discussion Discussion is needed before proceeding enhancement New feature or request

Comments

@ariebovenberg
Copy link
Owner

It'd make sense to be able to round datetimes in different ways:

  • by method: (banker's) rounding, ceil, floor
  • by unit: seconds, minutes, hours, etc.
  • by amount: 15 minutes, 30 seconds, etc.

The temporal API probably gives a big hint for doing this.

@BurntSushi
Copy link

Yeah, the Temporal API does indeed provide rounding APIs for datetime types. But what's even more useful, IMO, is rounding and re-balancing for durations. There are a lot of options availabe on, for example, ZonedDateTime.until that permit rounding the span returned or even choosing the "biggest" unit.

@ariebovenberg
Copy link
Owner Author

When it comes to re-balancing of durations, this issue is relevant as well: #108.

@ariebovenberg ariebovenberg added the discussion Discussion is needed before proceeding label Jul 12, 2024
@ariebovenberg ariebovenberg self-assigned this Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion is needed before proceeding enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants