Skip to content

Commit 3e4d3e8

Browse files
committed
Updates documentation
1 parent b2fc40c commit 3e4d3e8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/index.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,25 @@ Like said in the introduction, you can use the timezone library
10891089
directly with standard ``datetime`` objects but with limitations, especially
10901090
when adding and subtracting time around transition times.
10911091

1092+
.. versionadded:: 0.6
1093+
1094+
You can now control the normalization behavior:
1095+
1096+
.. code-block:: python
1097+
1098+
from datetime import datetime, timedelta
1099+
from pendulum import timezone
1100+
1101+
tz = timezone('Europe/Paris')
1102+
1103+
dt = datetime(2013, 3, 31, 2, 30)
1104+
dt = tz.convert(dt, dst_rule=tz.PRE_TRANSITION)
1105+
dt.isoformat()
1106+
'2013-03-31T02:30:00+01:00'
1107+
tz.convert(dt, dst_rule=tz.TRANSITION_ERROR)
1108+
# NonExistingTime: The datetime 2013-03-31 02:30:00 does not exist.
1109+
1110+
10921111
.. code-block:: python
10931112
10941113
from datetime import datetime, timedelta

0 commit comments

Comments
 (0)