mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
Merged revisions 81489 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81489 | georg.brandl | 2010-05-23 17:29:29 -0400 (Sun, 23 May 2010) | 1 line #1436346: make it more obvious that timetuple[7] is yday. ........
This commit is contained in:
parent
9dd47b891d
commit
649124856a
1 changed files with 10 additions and 7 deletions
|
@ -480,7 +480,9 @@ Instance methods:
|
|||
Return a :class:`time.struct_time` such as returned by :func:`time.localtime`.
|
||||
The hours, minutes and seconds are 0, and the DST flag is -1. ``d.timetuple()``
|
||||
is equivalent to ``time.struct_time((d.year, d.month, d.day, 0, 0, 0,
|
||||
d.weekday(), d.toordinal() - date(d.year, 1, 1).toordinal() + 1, -1))``
|
||||
d.weekday(), yday, -1))``, where ``yday = d.toordinal() - date(d.year, 1,
|
||||
1).toordinal() + 1`` is the day number within the current year starting with
|
||||
``1`` for January 1st.
|
||||
|
||||
|
||||
.. method:: date.toordinal()
|
||||
|
@ -944,12 +946,13 @@ Instance methods:
|
|||
|
||||
Return a :class:`time.struct_time` such as returned by :func:`time.localtime`.
|
||||
``d.timetuple()`` is equivalent to ``time.struct_time((d.year, d.month, d.day,
|
||||
d.hour, d.minute, d.second, d.weekday(), d.toordinal() - date(d.year, 1,
|
||||
1).toordinal() + 1, dst))`` The :attr:`tm_isdst` flag of the result is set
|
||||
according to the :meth:`dst` method: :attr:`tzinfo` is ``None`` or :meth:`dst`
|
||||
returns ``None``, :attr:`tm_isdst` is set to ``-1``; else if :meth:`dst`
|
||||
returns a non-zero value, :attr:`tm_isdst` is set to ``1``; else ``tm_isdst`` is
|
||||
set to ``0``.
|
||||
d.hour, d.minute, d.second, d.weekday(), yday, dst))``, where ``yday =
|
||||
d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the day number within
|
||||
the current year starting with ``1`` for January 1st. The :attr:`tm_isdst` flag
|
||||
of the result is set according to the :meth:`dst` method: :attr:`tzinfo` is
|
||||
``None`` or :meth:`dst`` returns ``None``, :attr:`tm_isdst` is set to ``-1``;
|
||||
else if :meth:`dst` returns a non-zero value, :attr:`tm_isdst` is set to ``1``;
|
||||
else ``tm_isdst`` is set to ``0``.
|
||||
|
||||
|
||||
.. method:: datetime.utctimetuple()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue