Skip to content

Commit

Permalink
bpo-31545: Update documentation containing timedelta repr. (pythonGH-…
Browse files Browse the repository at this point in the history
…3687)

This is a fix to the documentation to reflect the changes merged
in as part of bpo-30302.
  • Loading branch information
musically-ut authored and berkerpeksag committed Oct 27, 2017
1 parent 63ae044 commit 843ea47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,13 @@ Example usage:
True
>>> ten_years = 10 * year
>>> ten_years, ten_years.days // 365
(datetime.timedelta(3650), 10)
(datetime.timedelta(days=3650), 10)
>>> nine_years = ten_years - year
>>> nine_years, nine_years.days // 365
(datetime.timedelta(3285), 9)
(datetime.timedelta(days=3285), 9)
>>> three_years = nine_years // 3
>>> three_years, three_years.days // 365
(datetime.timedelta(1095), 3)
(datetime.timedelta(days=1095), 3)
>>> abs(three_years - ten_years) == 2 * three_years + year
True

Expand Down Expand Up @@ -1354,12 +1354,12 @@ Using datetime with tzinfo:
>>> dt1.dst()
datetime.timedelta(0)
>>> dt1.utcoffset()
datetime.timedelta(0, 3600)
datetime.timedelta(seconds=3600)
>>> dt2 = datetime(2006, 6, 14, 13, 0, tzinfo=gmt1)
>>> dt2.dst()
datetime.timedelta(0, 3600)
datetime.timedelta(seconds=3600)
>>> dt2.utcoffset()
datetime.timedelta(0, 7200)
datetime.timedelta(seconds=7200)
>>> # Convert datetime to another time zone
>>> dt3 = dt2.astimezone(GMT2())
>>> dt3 # doctest: +ELLIPSIS
Expand Down

0 comments on commit 843ea47

Please sign in to comment.