]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Make get_timezone_name use the current time if not given arguments
authorArmin Ronacher <armin.ronacher@active-4.com>
Sat, 6 Jul 2013 12:26:32 +0000 (14:26 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sat, 6 Jul 2013 12:26:32 +0000 (14:26 +0200)
babel/dates.py

index a4a0beb9e13753313beba4bf0f8f6b0cf26b1487..ef1d169d1a5d2752aa139c9b69b57b66b0491c81 100644 (file)
@@ -337,7 +337,7 @@ def get_timezone_location(dt_or_tzinfo=None, locale=LC_TIME):
     :since: version 0.9
     """
     if dt_or_tzinfo is None:
-        dt = None
+        dt = datetime.now()
         tzinfo = LOCALTZ
     elif isinstance(dt_or_tzinfo, basestring):
         dt = None
@@ -449,7 +449,7 @@ def get_timezone_name(dt_or_tzinfo=None, width='long', uncommon=False,
             <http://www.unicode.org/reports/tr35/#Time_Zone_Fallback>`_
     """
     if dt_or_tzinfo is None:
-        dt = None
+        dt = datetime.now()
         tzinfo = LOCALTZ
     elif isinstance(dt_or_tzinfo, basestring):
         dt = None