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

Human-readable time durations #327

Merged
merged 1 commit into from
Feb 9, 2024
Merged

Human-readable time durations #327

merged 1 commit into from
Feb 9, 2024

Conversation

sharkdp
Copy link
Owner

@sharkdp sharkdp commented Feb 9, 2024

This allows us to do things like

>>> 1 sidereal_day // human

  = 23 hours + 56 minutes + 4.090500 seconds    [String]

Or

>>> ten million seconds // human

  = 115 days + 17 hours + 46 minutes + 40 seconds    [String]

Once we implement #202, we can also write those as conversions (1 siderreal_day -> human)

related: #181

@triallax
Copy link
Collaborator

triallax commented Feb 9, 2024

I know it'd be a bit more verbose, but it would be nice if the code output e.g. 1 hour instead of 1 hours.

This allows us to do things like

    >>> 1 sidereal_day // human

      = 23 hours + 56 minutes + 4.090500 seconds    [String]

Or

    >>> ten million seconds // human

      = 115 days + 17 hours + 46 minutes + 40 seconds    [String]
@sharkdp sharkdp merged commit 721ed32 into master Feb 9, 2024
15 checks passed
@sharkdp sharkdp deleted the human-readable-durations branch February 9, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants