diff options
Diffstat (limited to 'docs/examples.rst')
-rw-r--r-- | docs/examples.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/examples.rst b/docs/examples.rst index 815e457..ce52c63 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -48,6 +48,15 @@ Next month, plus one week, at 10am. >>> TODAY+relativedelta(months=+1, weeks=+1, hour=10) datetime.datetime(2003, 10, 24, 10, 0) +Here is another example using an absolute relativedelta. Notice the use of +year and month (both singular) which causes the values to be *replaced* in the +original datetime rather than performing an arithmetic operation on them. + +.. doctest:: relativedelta + + >>> NOW+relativedelta(year=1, month=1) + datetime(1, 1, 17, 20, 54, 47, 282310) + Let's try the other way around. Notice that the hour setting we get in the relativedelta is relative, since it's a difference, and the weeks parameter |