2 ms·
> I agree that arrow's multi-locale natural language renderer does add a lot of value. Although I'd argue it should be unbundled into its own module http://bab
by masklinn 10y ago
> I agree that arrow's multi-locale natural language renderer does add a lot of value. Although I'd argue it should be unbundled into its own module
http://babel.pocoo.org/en/latest/api/dates.html http://babel.pocoo.org/en/latest/api/dates.html
humanize is apparently a human-readable directioned delta, so that'd be format_timedelta(delta, add_direction=True)
>>> print format_timedelta(ref - datetime.now(), add_direction=True)
1 hour ago
>>> print format_timedelta(ref - datetime.now(), add_direction=True, locale='zh')
1小时前
>>> print format_timedelta(ref - datetime.now(), add_direction=True, locale='ru')
1 час назад