python-humanfriendly icon indicating copy to clipboard operation
python-humanfriendly copied to clipboard

parse_timespan: add support for an "abbreviated" output

Open sandrotosi opened this issue 5 years ago • 1 comments

In [52]: humanfriendly.format_timespan(2576)
Out[52]: '42 minutes and 56 seconds'

it would be great if an abbreviated=True argument was present to produce:

In [52]: humanfriendly.format_timespan(2576, abbreviated=True)
Out[52]: '42m 56s'

parse_timespan accepts that shortened version already.

thanks!

sandrotosi avatar Mar 16 '20 17:03 sandrotosi

That would be format_timestamp. I'd like to have this too.

fsaintjacques avatar Jun 01 '20 15:06 fsaintjacques