aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dateutil/tz/tz.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/dateutil/tz/tz.py b/dateutil/tz/tz.py
index eb0ff6f..496148f 100644
--- a/dateutil/tz/tz.py
+++ b/dateutil/tz/tz.py
@@ -38,6 +38,22 @@ class tzutc(datetime.tzinfo):
"""
This is a tzinfo object that represents the UTC time zone.
+ **Examples:**
+
+ .. doctest::
+
+ >>> from datetime import *
+ >>> from dateutil.tz import *
+
+ >>> datetime.now()
+ datetime.datetime(2003, 9, 27, 9, 40, 1, 521290)
+
+ >>> datetime.now(tzutc())
+ datetime.datetime(2003, 9, 27, 12, 40, 12, 156379, tzinfo=tzutc())
+
+ >>> datetime.now(tzutc()).tzname()
+ 'UTC'
+
.. versionchanged:: 2.7.0
``tzutc()`` is now a singleton, so the result of ``tzutc()`` will
always return the same object.