Skip to content

Conversation

@jbsmith7741
Copy link

This is a proposal for issue #55 by adding a new humanize.Duration(format string, d time.Duration) function.
supports year, month (30 days), week, day, hour, minute and seconds. zero values fields are not populated and times are broken down by the requested formats. Examples are in tests

@alexykot
Copy link

alexykot commented Mar 9, 2021

Any chance to get this merged? I need this function as well, but we'll have to maintain a fork until this PR is merged.

@sheldonhull
Copy link

Bump. This would be a nice humanize feature I've missed from other languages. Duration for stop watch type output being human friendly would be pretty nifty.

@mooijtech
Copy link

Would be nice to have this, 2023 now, no right to complain I could do it myself.
You can get a time.Time from a Duration like so: endTime := time.Now().Add(-time.Since(startTime))
Nice library.

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.

4 participants