-
Notifications
You must be signed in to change notification settings - Fork 150
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
Feature request: naturaltime with UTC support or against arbitrary datetimes #46
Comments
Quick patch for python3: from datetime import datetime, timezone
from unittest import mock
from humanize import time as humanize_time
def now():
return datetime.now(timezone.utc)
def naturaltime(dt):
if dt.tzinfo is None:
return humanize_time.naturaltime(dt)
with mock.patch.object(humanize_time, '_now', side_effect=now):
return humanize_time.naturaltime(dt) |
🚀 Development has moved to https://github.com/python-humanize/humanize 🚀 Please open new issues at https://github.com/python-humanize/humanize/issues |
GitHub has a repo move feature which doesn't shove this burden onto literally everyone who has submitted an issue -_- |
Sorry about that, unfortunately I don't have admin access to this repo, only write, which is also the reason for the move (to be able to set up integrations to help with maintenance): python-humanize/humanize#3). Luckily there weren't too many issues here. |
The text was updated successfully, but these errors were encountered: