Skip to content

Commit

Permalink
Use conventional import datetime as dt in docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
phijor committed Oct 3, 2020
1 parent 3c800b0 commit b37dc30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/humanize/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ def naturaldelta(value, months=True, minimum_unit="seconds", when=None):
Examples
Compare two timestamps in a custom local timezone::
from datetime import datetime, timedelta, timezone
import datetime as dt
from dateutil.tz import gettz
berlin = gettz("Europe/Berlin")
now = datetime.now(tz=berlin)
later = now + timedelta(minutes=30)
now = dt.datetime.now(tz=berlin)
later = now + dt.timedelta(minutes=30)
assert naturaldelta(later, when=now) == "30 minutes"
"""
Expand Down

0 comments on commit b37dc30

Please sign in to comment.