]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Month and Day must be valid tokens 574/head
authorPTrottier <31802216+PTrottier@users.noreply.github.com>
Fri, 27 Apr 2018 14:42:56 +0000 (10:42 -0400)
committerGitHub <noreply@github.com>
Fri, 27 Apr 2018 14:42:56 +0000 (10:42 -0400)
````>>> dt = datetime(2007, 04, 01, 15, 30, tzinfo=UTC)
  File "<stdin>", line 1
    dt = datetime(2007, 04, 01, 15, 30, tzinfo=UTC)
                         ^
SyntaxError: invalid token````

See: https://docs.python.org/3.5/library/datetime.html#datetime.datetime.month

docs/dates.rst

index bb3398abbef84b97c2c9719b158d188781db7f02..0ddd7bc9519878c3e335b436b7f9ffb2d9db9dd0 100644 (file)
@@ -286,7 +286,7 @@ directly interface with it from within Babel:
 
     >>> from datetime import time
     >>> from babel.dates import get_timezone, UTC
-    >>> dt = datetime(2007, 04, 01, 15, 30, tzinfo=UTC)
+    >>> dt = datetime(2007, 4, 1, 15, 30, tzinfo=UTC)
     >>> eastern = get_timezone('US/Eastern')
     >>> format_datetime(dt, 'H:mm Z', tzinfo=eastern, locale='en_US')
     u'11:30 -0400'