From b37dc30ba61c2446eecb1a9d3e9ac8c9adf00f03 Mon Sep 17 00:00:00 2001 From: Philipp Joram Date: Sat, 3 Oct 2020 09:28:49 +0200 Subject: [PATCH] Use conventional `import datetime as dt` in docstring --- src/humanize/time.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/humanize/time.py b/src/humanize/time.py index 0e4d8812..bc1922c0 100644 --- a/src/humanize/time.py +++ b/src/humanize/time.py @@ -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" """