mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
fix highlight in the datetime example
This commit is contained in:
parent
7232d41569
commit
c4cd6d3765
1 changed files with 2 additions and 2 deletions
|
@ -179,7 +179,7 @@ focus of the implementation is on efficient member extraction for output
|
||||||
formatting and manipulation. The module also supports objects that are timezone
|
formatting and manipulation. The module also supports objects that are timezone
|
||||||
aware. ::
|
aware. ::
|
||||||
|
|
||||||
# dates are easily constructed and formatted
|
>>> # dates are easily constructed and formatted
|
||||||
>>> from datetime import date
|
>>> from datetime import date
|
||||||
>>> now = date.today()
|
>>> now = date.today()
|
||||||
>>> now
|
>>> now
|
||||||
|
@ -187,7 +187,7 @@ aware. ::
|
||||||
>>> now.strftime("%m-%d-%y. %d %b %Y is a %A on the %d day of %B.")
|
>>> now.strftime("%m-%d-%y. %d %b %Y is a %A on the %d day of %B.")
|
||||||
'12-02-03. 02 Dec 2003 is a Tuesday on the 02 day of December.'
|
'12-02-03. 02 Dec 2003 is a Tuesday on the 02 day of December.'
|
||||||
|
|
||||||
# dates support calendar arithmetic
|
>>> # dates support calendar arithmetic
|
||||||
>>> birthday = date(1964, 7, 31)
|
>>> birthday = date(1964, 7, 31)
|
||||||
>>> age = now - birthday
|
>>> age = now - birthday
|
||||||
>>> age.days
|
>>> age.days
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue