aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/examples.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/examples.rst b/docs/examples.rst
index 2b98dbd..21270ca 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -1190,6 +1190,19 @@ Other random formats:
datetime.datetime(1990, 6, 13, 5, 50)
+Override parserinfo with a custom parserinfo
+
+.. doctest:: tz
+
+ >>> from dateutil.parser import parse, parserinfo
+ >>> class CustomParserInfo(parserinfo):
+ ... # e.g. edit a property of parserinfo to allow a custom 12 hour format
+ ... AMPM = [("am", "a", "xm"), ("pm", "p")]
+ >>> parse('2018-06-08 12:06:58 XM', parserinfo=CustomParserInfo())
+ datetime.datetime(2018, 6, 8, 0, 6, 58)
+
+
+
tzutc examples
--------------