#1436346: make it more obvious that timetuple[7] is yday.

This commit is contained in:
Georg Brandl 2010-05-23 21:29:29 +00:00
parent fee0f44b91
commit 151973e1c8
1 changed files with 10 additions and 7 deletions

View File

@ -455,7 +455,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()
@ -920,12 +922,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()