chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
240e44b7-806d-416d-a25c-8df0b042fdca | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,883 | supabase-export-v2 | 01cccce7b71cef14 | When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive only affects the output hour field if the ``%I`` directive is used to parse the hour.
(4)
Unlike the :mod:`time` module, the :mod:`!datetime` module does not support
leap seconds. | trusted_official_docs | CPython Docs | When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive only affects the output hour field if the ``%I`` directive is used to parse the hour.
(4)
Unlike the :mod:`time` module, the :mod:`!datetime` module does not support
leap seconds. | When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive only affects the output hour field if the ``%I`` directive is used to parse the hour.
(4)
Unlike the :mod:`time` module, the :mod:`!datetime` module does not support
leap seconds. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2552538f-5cdc-4fa5-845d-25676608b7ca | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,896 | supabase-export-v2 | 7d86a50f2b421e10 | So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid values, but probably not ``EST``. It will raise ``ValueError`` for invalid values.
.. versionchanged:: 3.2
When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` method, an
aware :class:`.datetime` object will be produced. Th... | trusted_official_docs | CPython Docs | So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid values, but probably not ``EST``. It will raise ``ValueError`` for invalid values.
.. versionchanged:: 3.2
When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` method, an
aware :class:`.datetime` object will be produced. Th... | So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid values, but probably not ``EST``. It will raise ``ValueError`` for invalid values.
.. versionchanged:: 3.2
When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` method, an
aware :class:`.datetime` object will be produced. Th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
25aee675-fcd9-446a-bc7f-1708c4ec26af | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,789 | supabase-export-v2 | 86a6cf0d326f1627 | .. literalinclude:: ../includes/tzinfo_examples.py
Note that there are unavoidable subtleties twice per year in a :class:`tzinfo`
subclass accounting for both standard and daylight time, at the DST transition
points. For concreteness, consider US Eastern (UTC -0500), where EDT begins the
minute after 1:59 (EST) on the ... | trusted_official_docs | CPython Docs | .. literalinclude:: ../includes/tzinfo_examples.py
Note that there are unavoidable subtleties twice per year in a :class:`tzinfo`
subclass accounting for both standard and daylight time, at the DST transition
points. For concreteness, consider US Eastern (UTC -0500), where EDT begins the
minute after 1:59 (EST) on the ... | .. literalinclude:: ../includes/tzinfo_examples.py
Note that there are unavoidable subtleties twice per year in a :class:`tzinfo`
subclass accounting for both standard and daylight time, at the DST transition
points. For concreteness, consider US Eastern (UTC -0500), where EDT begins the
minute after 1:59 (EST) on the ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
25d15763-ff52-4680-96a0-3911ee191764 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,839 | supabase-export-v2 | 56558135bc39299d | | | | || So, Mo, ..., Sa | | | | | (de_DE) | | +-----------+--------------------------------+------------------------+-------+ | ``%A`` | Weekday as locale's full name.
|| Sunday, Monday, ..., | \(1) |
| | | Saturday (en_US); | |
| | || Sonntag, Montag, ..., | |
| | | Samstag (de_DE) | |
+-----------+------------------... | trusted_official_docs | CPython Docs | | | | || So, Mo, ..., Sa | | | | | (de_DE) | | +-----------+--------------------------------+------------------------+-------+ | ``%A`` | Weekday as locale's full name.
|| Sunday, Monday, ..., | \(1) |
| | | Saturday (en_US); | |
| | || Sonntag, Montag, ..., | |
| | | Samstag (de_DE) | |
+-----------+------------------... | | | | || So, Mo, ..., Sa | | | | | (de_DE) | | +-----------+--------------------------------+------------------------+-------+ | ``%A`` | Weekday as locale's full name.
|| Sunday, Monday, ..., | \(1) |
| | | Saturday (en_US); | |
| | || Sonntag, Montag, ..., | |
| | | Samstag (de_DE) | |
+-----------+------------------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
28390d82-0ea2-42d3-b199-a68bb55870b3 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,476 | supabase-export-v2 | cbe7c05d8e90e25d | Return the current UTC date and time, with :attr:`.tzinfo` ``None``.
This is like :meth:`now`, but returns the current UTC date and time, as a naive
:class:`.datetime` object. An aware current UTC datetime can be obtained by
calling ``datetime.now(timezone.utc)``. See also :meth:`now`. | trusted_official_docs | CPython Docs | Return the current UTC date and time, with :attr:`.tzinfo` ``None``.
This is like :meth:`now`, but returns the current UTC date and time, as a naive
:class:`.datetime` object. An aware current UTC datetime can be obtained by
calling ``datetime.now(timezone.utc)``. See also :meth:`now`. | Return the current UTC date and time, with :attr:`.tzinfo` ``None``.
This is like :meth:`now`, but returns the current UTC date and time, as a naive
:class:`.datetime` object. An aware current UTC datetime can be obtained by
calling ``datetime.now(timezone.utc)``. See also :meth:`now`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2907e1c2-36b4-4589-8918-6a74adfa8e99 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,893 | supabase-export-v2 | 221b637286949bf9 | :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by the returned value, which must be a string.
:meth:`~.datetime.strptime` only accepts certain values for ``%Z``: | trusted_official_docs | CPython Docs | :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by the returned value, which must be a string.
:meth:`~.datetime.strptime` only accepts certain values for ``%Z``: | :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by the returned value, which must be a string.
:meth:`~.datetime.strptime` only accepts certain values for ``%Z``: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
291959b7-42f5-48a8-aea0-b8cfde717552 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,892 | supabase-export-v2 | 2891b107741db0c6 | and seconds. For example, ``'+01:00:00'`` (but *not* ``'+010000'``) will be parsed as an offset of one hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``.
``%Z``
In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if
:meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is repl... | trusted_official_docs | CPython Docs | and seconds. For example, ``'+01:00:00'`` (but *not* ``'+010000'``) will be parsed as an offset of one hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``.
``%Z``
In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if
:meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is repl... | and seconds. For example, ``'+01:00:00'`` (but *not* ``'+010000'``) will be parsed as an offset of one hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``.
``%Z``
In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if
:meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is repl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2bb22131-6ed2-4687-b8ff-d8a34d46cda2 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,899 | supabase-export-v2 | c8cb0065dbe3b281 | day of the week and the ISO year (``%G``) are specified in a :meth:`~.datetime.strptime` format string. Also note that ``%G`` and ``%Y`` are not interchangeable.
(9)
When used with the :meth:`~.datetime.strptime` method, the leading zero is optional
for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ... | trusted_official_docs | CPython Docs | day of the week and the ISO year (``%G``) are specified in a :meth:`~.datetime.strptime` format string. Also note that ``%G`` and ``%Y`` are not interchangeable.
(9)
When used with the :meth:`~.datetime.strptime` method, the leading zero is optional
for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ... | day of the week and the ISO year (``%G``) are specified in a :meth:`~.datetime.strptime` format string. Also note that ``%G`` and ``%Y`` are not interchangeable.
(9)
When used with the :meth:`~.datetime.strptime` method, the leading zero is optional
for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2bf38549-f20e-41fa-a120-c28551f12b7e | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,282 | supabase-export-v2 | 502b99ca5351c624 | The following example illustrates how any arguments besides *days*, *seconds* and *microseconds* are "merged" and normalized into those three resulting attributes::
>>> import datetime as dt
>>> delta = dt.timedelta(
... days=50,
... seconds=27,
... microseconds=10,
... milliseconds=29000,
... minutes=5,
... hou... | trusted_official_docs | CPython Docs | The following example illustrates how any arguments besides *days*, *seconds* and *microseconds* are "merged" and normalized into those three resulting attributes::
>>> import datetime as dt
>>> delta = dt.timedelta(
... days=50,
... seconds=27,
... microseconds=10,
... milliseconds=29000,
... minutes=5,
... hou... | The following example illustrates how any arguments besides *days*, *seconds* and *microseconds* are "merged" and normalized into those three resulting attributes::
>>> import datetime as dt
>>> delta = dt.timedelta(
... days=50,
... seconds=27,
... microseconds=10,
... milliseconds=29000,
... minutes=5,
... hou... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2c1b89d1-eb7c-4a47-94bc-4bf9247297b1 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,322 | supabase-export-v2 | ba32ca647d65972d | >>> timedelta(hours=-5) datetime.timedelta(days=-1, seconds=68400) >>> print(_) -1 day, 19:00:00
(6)
The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-t3)`` except
when t3 is equal to ``timedelta.max``; in that case the former will produce a result
while the latter will overflow. | trusted_official_docs | CPython Docs | >>> timedelta(hours=-5) datetime.timedelta(days=-1, seconds=68400) >>> print(_) -1 day, 19:00:00
(6)
The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-t3)`` except
when t3 is equal to ``timedelta.max``; in that case the former will produce a result
while the latter will overflow. | >>> timedelta(hours=-5) datetime.timedelta(days=-1, seconds=68400) >>> print(_) -1 day, 19:00:00
(6)
The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-t3)`` except
when t3 is equal to ``timedelta.max``; in that case the former will produce a result
while the latter will overflow. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2c39d594-89f8-4e9b-927b-2d16e45ad420 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,667 | supabase-export-v2 | ace19d142ebec5d4 | with a tzinfo set to self. # See datetime.astimezone or fromtimestamp. if when.replace(tzinfo=dt.timezone.utc) >= self.UTC_MOVE_DATE: return when + dt.timedelta(hours=4, minutes=30) else: return when + dt.timedelta(hours=4)
def dst(self, when):
# Kabul does not observe daylight saving time. return dt.timedelta(0) | trusted_official_docs | CPython Docs | with a tzinfo set to self. # See datetime.astimezone or fromtimestamp. if when.replace(tzinfo=dt.timezone.utc) >= self.UTC_MOVE_DATE: return when + dt.timedelta(hours=4, minutes=30) else: return when + dt.timedelta(hours=4)
def dst(self, when):
# Kabul does not observe daylight saving time. return dt.timedelta(0) | with a tzinfo set to self. # See datetime.astimezone or fromtimestamp. if when.replace(tzinfo=dt.timezone.utc) >= self.UTC_MOVE_DATE: return when + dt.timedelta(hours=4, minutes=30) else: return when + dt.timedelta(hours=4)
def dst(self, when):
# Kabul does not observe daylight saving time. return dt.timedelta(0) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e4aeb33-460f-4f19-bd2c-7435bc040f0a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,340 | supabase-export-v2 | 88de3087e020c0d5 | A :class:`date` object represents a date (year, month and day) in an idealized calendar, the current Gregorian calendar indefinitely extended in both directions.
January 1 of year 1 is called day number 1, January 2 of year 1 is
called day number 2, and so on. [#]_ | trusted_official_docs | CPython Docs | A :class:`date` object represents a date (year, month and day) in an idealized calendar, the current Gregorian calendar indefinitely extended in both directions.
January 1 of year 1 is called day number 1, January 2 of year 1 is
called day number 2, and so on. [#]_ | A :class:`date` object represents a date (year, month and day) in an idealized calendar, the current Gregorian calendar indefinitely extended in both directions.
January 1 of year 1 is called day number 1, January 2 of year 1 is
called day number 2, and so on. [#]_ | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2edad1f2-b015-4758-9200-35fafccc94e8 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,782 | supabase-export-v2 | 4fd4b50c7d3bcfaa | .. method:: tzinfo.fromutc(dt)
This is called from the default :meth:`datetime.astimezone`
implementation. When called from that, ``dt.tzinfo`` is *self*, and *dt*'s
date and time data are to be viewed as expressing a UTC time. The purpose
of :meth:`fromutc` is to adjust the date and time data, returning an
equival... | trusted_official_docs | CPython Docs | .. method:: tzinfo.fromutc(dt)
This is called from the default :meth:`datetime.astimezone`
implementation. When called from that, ``dt.tzinfo`` is *self*, and *dt*'s
date and time data are to be viewed as expressing a UTC time. The purpose
of :meth:`fromutc` is to adjust the date and time data, returning an
equival... | .. method:: tzinfo.fromutc(dt)
This is called from the default :meth:`datetime.astimezone`
implementation. When called from that, ``dt.tzinfo`` is *self*, and *dt*'s
date and time data are to be viewed as expressing a UTC time. The purpose
of :meth:`fromutc` is to adjust the date and time data, returning an
equival... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2f56c75e-70d2-4498-9980-67f0562c07a5 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,778 | supabase-export-v2 | d495e40de055ba88 | object passes ``None`` as the argument. A :class:`tzinfo` subclass's methods should therefore be prepared to accept a *dt* argument of ``None``, or of class :class:`!datetime`.
When ``None`` is passed, it's up to the class designer to decide the best
response. For example, returning ``None`` is appropriate if the class... | trusted_official_docs | CPython Docs | object passes ``None`` as the argument. A :class:`tzinfo` subclass's methods should therefore be prepared to accept a *dt* argument of ``None``, or of class :class:`!datetime`.
When ``None`` is passed, it's up to the class designer to decide the best
response. For example, returning ``None`` is appropriate if the class... | object passes ``None`` as the argument. A :class:`tzinfo` subclass's methods should therefore be prepared to accept a *dt* argument of ``None``, or of class :class:`!datetime`.
When ``None`` is passed, it's up to the class designer to decide the best
response. For example, returning ``None`` is appropriate if the class... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
32114590-30e8-4103-a586-a12c0feb6293 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,858 | supabase-export-v2 | 3daad5504b0cfd0d | full set of format codes supported on your platform, consult the :manpage:`strftime(3)` documentation. There are also differences between platforms in handling of unsupported format specifiers.
.. versionadded:: 3.6
``%G``, ``%u`` and ``%V`` were added. | trusted_official_docs | CPython Docs | full set of format codes supported on your platform, consult the :manpage:`strftime(3)` documentation. There are also differences between platforms in handling of unsupported format specifiers.
.. versionadded:: 3.6
``%G``, ``%u`` and ``%V`` were added. | full set of format codes supported on your platform, consult the :manpage:`strftime(3)` documentation. There are also differences between platforms in handling of unsupported format specifiers.
.. versionadded:: 3.6
``%G``, ``%u`` and ``%V`` were added. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
32bf68b1-47d7-4465-b15a-55732105a8a4 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,398 | supabase-export-v2 | 2fd1bd5115199d99 | *date1* is considered less than *date2* when *date1* precedes *date2* in time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2.toordinal()``.
Order comparison between a :class:`date` object that is not also a
:class:`.datetime` instance and a :class:`!datetime` object raises
:exc:`TypeErr... | trusted_official_docs | CPython Docs | *date1* is considered less than *date2* when *date1* precedes *date2* in time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2.toordinal()``.
Order comparison between a :class:`date` object that is not also a
:class:`.datetime` instance and a :class:`!datetime` object raises
:exc:`TypeErr... | *date1* is considered less than *date2* when *date1* precedes *date2* in time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2.toordinal()``.
Order comparison between a :class:`date` object that is not also a
:class:`.datetime` instance and a :class:`!datetime` object raises
:exc:`TypeErr... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3313457d-ffe3-48d9-aa4d-ec446c1a1184 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,656 | supabase-export-v2 | 7961c37c560e8faf | >>> # Using datetime.combine() >>> d = dt.date(2005, 7, 14) >>> t = dt.time(12, 30) >>> dt.datetime.combine(d, t) datetime.datetime(2005, 7, 14, 12, 30)
>>> # Using datetime.now()
>>> dt.datetime.now() # doctest: +SKIP
datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1
>>> dt.datetime.now(dt.timezone.utc) # ... | trusted_official_docs | CPython Docs | >>> # Using datetime.combine() >>> d = dt.date(2005, 7, 14) >>> t = dt.time(12, 30) >>> dt.datetime.combine(d, t) datetime.datetime(2005, 7, 14, 12, 30)
>>> # Using datetime.now()
>>> dt.datetime.now() # doctest: +SKIP
datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1
>>> dt.datetime.now(dt.timezone.utc) # ... | >>> # Using datetime.combine() >>> d = dt.date(2005, 7, 14) >>> t = dt.time(12, 30) >>> dt.datetime.combine(d, t) datetime.datetime(2005, 7, 14, 12, 30)
>>> # Using datetime.now()
>>> dt.datetime.now() # doctest: +SKIP
datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1
>>> dt.datetime.now(dt.timezone.utc) # ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3319f495-e86c-46f8-9c9f-0bbe3b32943e | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,392 | supabase-export-v2 | 0f7ed5ec5468e293 | Notes:
(1)
*date2* is moved forward in time if ``timedelta.days > 0``, or backward if
``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. ``timedelta.seconds`` and ``timedelta.microseconds`` are ignored. :exc:`OverflowError` is raised if ``date2.year`` would be smaller than
:const:`MINYEAR` or lar... | trusted_official_docs | CPython Docs | Notes:
(1)
*date2* is moved forward in time if ``timedelta.days > 0``, or backward if
``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. ``timedelta.seconds`` and ``timedelta.microseconds`` are ignored. :exc:`OverflowError` is raised if ``date2.year`` would be smaller than
:const:`MINYEAR` or lar... | Notes:
(1)
*date2* is moved forward in time if ``timedelta.days > 0``, or backward if
``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. ``timedelta.seconds`` and ``timedelta.microseconds`` are ignored. :exc:`OverflowError` is raised if ``date2.year`` would be smaller than
:const:`MINYEAR` or lar... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
33caf2ad-1e16-445a-a87a-15518aa958e3 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,290 | supabase-export-v2 | 00c6e7ba0bcc2c6f | .. code-block:: pycon
>>> def pretty_timedelta(td):
... if td.days >= 0:
... return str(td)
... return f'-({-td!s})'
... >>> d = timedelta(hours=-1)
>>> str(d) # not human-friendly
'-1 day, 23:00:00'
>>> pretty_timedelta(d)
'-(1:00:00)' | trusted_official_docs | CPython Docs | .. code-block:: pycon
>>> def pretty_timedelta(td):
... if td.days >= 0:
... return str(td)
... return f'-({-td!s})'
... >>> d = timedelta(hours=-1)
>>> str(d) # not human-friendly
'-1 day, 23:00:00'
>>> pretty_timedelta(d)
'-(1:00:00)' | .. code-block:: pycon
>>> def pretty_timedelta(td):
... if td.days >= 0:
... return str(td)
... return f'-({-td!s})'
... >>> d = timedelta(hours=-1)
>>> str(d) # not human-friendly
'-1 day, 23:00:00'
>>> pretty_timedelta(d)
'-(1:00:00)' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
33ec80e2-e806-4714-97fa-f5d0ed8957ad | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,776 | supabase-export-v2 | 177776d58e0b8a7d | subclasses will wish to return different names depending on the specific value of *dt* passed, especially if the :class:`!tzinfo` class is accounting for daylight time.
The default implementation of :meth:`tzname` raises :exc:`NotImplementedError`. | trusted_official_docs | CPython Docs | subclasses will wish to return different names depending on the specific value of *dt* passed, especially if the :class:`!tzinfo` class is accounting for daylight time.
The default implementation of :meth:`tzname` raises :exc:`NotImplementedError`. | subclasses will wish to return different names depending on the specific value of *dt* passed, especially if the :class:`!tzinfo` class is accounting for daylight time.
The default implementation of :meth:`tzname` raises :exc:`NotImplementedError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
34090e5b-7af9-494c-93e1-b1b84dbe8b6d | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,547 | supabase-export-v2 | 5fc630d868aca391 | Supported operations:
+---------------------------------------+--------------------------------+
| Operation | Result |
+=======================================+================================+
| ``datetime2 = datetime1 + timedelta`` | \(1) |
+---------------------------------------+--------------------------------+
|... | trusted_official_docs | CPython Docs | Supported operations:
+---------------------------------------+--------------------------------+
| Operation | Result |
+=======================================+================================+
| ``datetime2 = datetime1 + timedelta`` | \(1) |
+---------------------------------------+--------------------------------+
|... | Supported operations:
+---------------------------------------+--------------------------------+
| Operation | Result |
+=======================================+================================+
| ``datetime2 = datetime1 + timedelta`` | \(1) |
+---------------------------------------+--------------------------------+
|... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
34203c0c-2c06-43be-8300-b2e4692bcc87 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,814 | supabase-export-v2 | b2d269e1f4bc0a78 | Return the fixed value specified when the :class:`timezone` instance is constructed.
The *dt* argument is ignored. The return value is a :class:`timedelta`
instance equal to the difference between the local time and UTC. | trusted_official_docs | CPython Docs | Return the fixed value specified when the :class:`timezone` instance is constructed.
The *dt* argument is ignored. The return value is a :class:`timedelta`
instance equal to the difference between the local time and UTC. | Return the fixed value specified when the :class:`timezone` instance is constructed.
The *dt* argument is ignored. The return value is a :class:`timedelta`
instance equal to the difference between the local time and UTC. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
35335a9d-45ea-4eba-8ef8-f1f4b886c6d3 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,801 | supabase-export-v2 | fa62d2ab331b2efe | :mod:`zoneinfo` The :mod:`!datetime` module has a basic :class:`timezone` class (for handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a UTC :class:`!timezone` instance).
``zoneinfo`` brings the *IANA time zone database* (also known as the Olson
database) to Python, and its usage is re... | trusted_official_docs | CPython Docs | :mod:`zoneinfo` The :mod:`!datetime` module has a basic :class:`timezone` class (for handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a UTC :class:`!timezone` instance).
``zoneinfo`` brings the *IANA time zone database* (also known as the Olson
database) to Python, and its usage is re... | :mod:`zoneinfo` The :mod:`!datetime` module has a basic :class:`timezone` class (for handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a UTC :class:`!timezone` instance).
``zoneinfo`` brings the *IANA time zone database* (also known as the Olson
database) to Python, and its usage is re... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
35b97681-61fd-481a-a803-f1fabef4901a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,832 | supabase-export-v2 | e507c332c99e0a25 | The table below provides a high-level comparison of :meth:`~.datetime.strftime` versus :meth:`~.datetime.strptime`:
+----------------+--------------------------------------------------------+------------------------------------------------------------+
| | ``strftime`` | ``strptime`` |
+================+===============... | trusted_official_docs | CPython Docs | The table below provides a high-level comparison of :meth:`~.datetime.strftime` versus :meth:`~.datetime.strptime`:
+----------------+--------------------------------------------------------+------------------------------------------------------------+
| | ``strftime`` | ``strptime`` |
+================+===============... | The table below provides a high-level comparison of :meth:`~.datetime.strftime` versus :meth:`~.datetime.strptime`:
+----------------+--------------------------------------------------------+------------------------------------------------------------+
| | ``strftime`` | ``strptime`` |
+================+===============... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3696f726-3b1c-476f-92a1-4cc268596254 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,763 | supabase-export-v2 | 56746c61034010e9 | attribute's :meth:`dst` method to determine how the :attr:`~time.struct_time.tm_isdst` flag should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for DST changes when crossing time zones.
An instance *tz* of a :class:`tzinfo` subclass that models both standard and
daylight times must be consistent in ... | trusted_official_docs | CPython Docs | attribute's :meth:`dst` method to determine how the :attr:`~time.struct_time.tm_isdst` flag should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for DST changes when crossing time zones.
An instance *tz* of a :class:`tzinfo` subclass that models both standard and
daylight times must be consistent in ... | attribute's :meth:`dst` method to determine how the :attr:`~time.struct_time.tm_isdst` flag should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for DST changes when crossing time zones.
An instance *tz* of a :class:`tzinfo` subclass that models both standard and
daylight times must be consistent in ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
36e124e5-63f0-46a5-bf79-603518f4c0b6 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,607 | supabase-export-v2 | 9ca882593b016c9d | the platform C functions on many platforms, this method may raise :exc:`OverflowError` or :exc:`OSError` for times far in the past or far in the future.
For aware :class:`.datetime` instances, the return value is computed
as:: | trusted_official_docs | CPython Docs | the platform C functions on many platforms, this method may raise :exc:`OverflowError` or :exc:`OSError` for times far in the past or far in the future.
For aware :class:`.datetime` instances, the return value is computed
as:: | the platform C functions on many platforms, this method may raise :exc:`OverflowError` or :exc:`OSError` for times far in the past or far in the future.
For aware :class:`.datetime` instances, the return value is computed
as:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
377d2299-62d8-4d65-8c3f-6fc4f9f031e9 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,313 | supabase-export-v2 | 8d7b19f24f2c2575 | | integer is returned. (3) | +--------------------------------+-----------------------------------------------+ | ``t1 = t2 % t3`` | The remainder is computed as a | | | :class:`timedelta` object.
(3) |
+--------------------------------+-----------------------------------------------+
| ``q, r = divmod(t1, t2)`` | Comp... | trusted_official_docs | CPython Docs | | integer is returned. (3) | +--------------------------------+-----------------------------------------------+ | ``t1 = t2 % t3`` | The remainder is computed as a | | | :class:`timedelta` object.
(3) |
+--------------------------------+-----------------------------------------------+
| ``q, r = divmod(t1, t2)`` | Comp... | | integer is returned. (3) | +--------------------------------+-----------------------------------------------+ | ``t1 = t2 % t3`` | The remainder is computed as a | | | :class:`timedelta` object.
(3) |
+--------------------------------+-----------------------------------------------+
| ``q, r = divmod(t1, t2)`` | Comp... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
37ee5ee8-b986-4e76-99b8-5fc5f91ecd90 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,891 | supabase-export-v2 | 9ec16ea9827e3aff | ``%:z`` When used with :meth:`~.datetime.strftime`, behaves exactly as ``%z``, except that a colon separator is added between hours, minutes and seconds.
When used with :meth:`~.datetime.strptime`, the UTC offset is *required*
to have a colon as a separator between hours, minutes and seconds. For example, ``'+01:00:00... | trusted_official_docs | CPython Docs | ``%:z`` When used with :meth:`~.datetime.strftime`, behaves exactly as ``%z``, except that a colon separator is added between hours, minutes and seconds.
When used with :meth:`~.datetime.strptime`, the UTC offset is *required*
to have a colon as a separator between hours, minutes and seconds. For example, ``'+01:00:00... | ``%:z`` When used with :meth:`~.datetime.strftime`, behaves exactly as ``%z``, except that a colon separator is added between hours, minutes and seconds.
When used with :meth:`~.datetime.strptime`, the UTC offset is *required*
to have a colon as a separator between hours, minutes and seconds. For example, ``'+01:00:00... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3845afe0-aafa-4544-b93b-360cddbe684a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,471 | supabase-export-v2 | 86a93d7ddf74e619 | *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass, and the current date and time are converted to *tz*’s time zone.
This function is preferred over :meth:`today` and :meth:`utcnow`. | trusted_official_docs | CPython Docs | *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass, and the current date and time are converted to *tz*’s time zone.
This function is preferred over :meth:`today` and :meth:`utcnow`. | *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass, and the current date and time are converted to *tz*’s time zone.
This function is preferred over :meth:`today` and :meth:`utcnow`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
392d4c45-b118-498c-a5f2-6836be743507 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,762 | supabase-export-v2 | 056f20073ee3fee3 | Return the daylight saving time (DST) adjustment, as a :class:`timedelta` object or ``None`` if DST information isn't known.
Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return the offset as a :class:`timedelta` object
(see :meth:`utcoffset` for details). Note that DST offset, if applicable, h... | trusted_official_docs | CPython Docs | Return the daylight saving time (DST) adjustment, as a :class:`timedelta` object or ``None`` if DST information isn't known.
Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return the offset as a :class:`timedelta` object
(see :meth:`utcoffset` for details). Note that DST offset, if applicable, h... | Return the daylight saving time (DST) adjustment, as a :class:`timedelta` object or ``None`` if DST information isn't known.
Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return the offset as a :class:`timedelta` object
(see :meth:`utcoffset` for details). Note that DST offset, if applicable, h... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3a2097b3-f5ef-436a-bad1-1f950acdd0e3 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,506 | supabase-export-v2 | b18ba7977bab7850 | the :attr:`~.time.tzinfo` attribute of the *time* argument is used. If the *date* argument is a :class:`!datetime` object, its time components and :attr:`.tzinfo` attributes are ignored.
For any :class:`.datetime` object ``d``,
``d == datetime.combine(d.date(), d.time(), d.tzinfo)``. | trusted_official_docs | CPython Docs | the :attr:`~.time.tzinfo` attribute of the *time* argument is used. If the *date* argument is a :class:`!datetime` object, its time components and :attr:`.tzinfo` attributes are ignored.
For any :class:`.datetime` object ``d``,
``d == datetime.combine(d.date(), d.time(), d.tzinfo)``. | the :attr:`~.time.tzinfo` attribute of the *time* argument is used. If the *date* argument is a :class:`!datetime` object, its time components and :attr:`.tzinfo` attributes are ignored.
For any :class:`.datetime` object ``d``,
``d == datetime.combine(d.date(), d.time(), d.tzinfo)``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3a7754a7-697a-4a31-8524-6f940bc7954a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,829 | supabase-export-v2 | bad4b2d9c5dd2b8a | :meth:`!strftime` and :meth:`!strptime` behavior ------------------------------------------------
:class:`date`, :class:`.datetime`, and :class:`.time` objects all support a
``strftime(format)`` method, to create a string representing the time under the
control of an explicit format string. | trusted_official_docs | CPython Docs | :meth:`!strftime` and :meth:`!strptime` behavior ------------------------------------------------
:class:`date`, :class:`.datetime`, and :class:`.time` objects all support a
``strftime(format)`` method, to create a string representing the time under the
control of an explicit format string. | :meth:`!strftime` and :meth:`!strptime` behavior ------------------------------------------------
:class:`date`, :class:`.datetime`, and :class:`.time` objects all support a
``strftime(format)`` method, to create a string representing the time under the
control of an explicit format string. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3a98cc78-e856-440c-8f71-dbbd7de1065e | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,523 | supabase-export-v2 | ab8dd1036ebccb59 | .. versionchanged:: 3.15
If *format* specifies a day of month (``%d``) without a year,
:exc:`ValueError` is raised. This is to avoid a quadrennial
leap year bug in code seeking to parse only a month and day as the
default year used in absence of one in the format is not a leap year. The workaround is to always inclu... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.15
If *format* specifies a day of month (``%d``) without a year,
:exc:`ValueError` is raised. This is to avoid a quadrennial
leap year bug in code seeking to parse only a month and day as the
default year used in absence of one in the format is not a leap year. The workaround is to always inclu... | .. versionchanged:: 3.15
If *format* specifies a day of month (``%d``) without a year,
:exc:`ValueError` is raised. This is to avoid a quadrennial
leap year bug in code seeking to parse only a month and day as the
default year used in absence of one in the format is not a leap year. The workaround is to always inclu... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3b0b618d-c261-4cd4-9600-5e3bd9651044 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,802 | supabase-export-v2 | 8f179136c095f566 | ``zoneinfo`` brings the *IANA time zone database* (also known as the Olson database) to Python, and its usage is recommended.
`IANA time zone database <https://www.iana.org/time-zones>`_
The Time Zone Database (often called tz, tzdata or zoneinfo) contains code
and data that represent the history of local time for ma... | trusted_official_docs | CPython Docs | ``zoneinfo`` brings the *IANA time zone database* (also known as the Olson database) to Python, and its usage is recommended.
`IANA time zone database <https://www.iana.org/time-zones>`_
The Time Zone Database (often called tz, tzdata or zoneinfo) contains code
and data that represent the history of local time for ma... | ``zoneinfo`` brings the *IANA time zone database* (also known as the Olson database) to Python, and its usage is recommended.
`IANA time zone database <https://www.iana.org/time-zones>`_
The Time Zone Database (often called tz, tzdata or zoneinfo) contains code
and data that represent the history of local time for ma... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3fc8c06a-ea43-45c9-b2b8-b5886596f7c8 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,637 | supabase-export-v2 | 0b7718b153c8be43 | :exc:`ValueError` will be raised on an invalid *timespec* argument::
>>> import datetime as dt
>>> dt.datetime.now().isoformat(timespec='minutes') # doctest: +SKIP
'2002-12-25T00:00'
>>> my_datetime = dt.datetime(2015, 1, 1, 12, 30, 59, 0)
>>> my_datetime.isoformat(timespec='microseconds')
'2015-01-01T12:30:59.000... | trusted_official_docs | CPython Docs | :exc:`ValueError` will be raised on an invalid *timespec* argument::
>>> import datetime as dt
>>> dt.datetime.now().isoformat(timespec='minutes') # doctest: +SKIP
'2002-12-25T00:00'
>>> my_datetime = dt.datetime(2015, 1, 1, 12, 30, 59, 0)
>>> my_datetime.isoformat(timespec='microseconds')
'2015-01-01T12:30:59.000... | :exc:`ValueError` will be raised on an invalid *timespec* argument::
>>> import datetime as dt
>>> dt.datetime.now().isoformat(timespec='minutes') # doctest: +SKIP
'2002-12-25T00:00'
>>> my_datetime = dt.datetime(2015, 1, 1, 12, 30, 59, 0)
>>> my_datetime.isoformat(timespec='microseconds')
'2015-01-01T12:30:59.000... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
417be13c-430b-484e-8a00-85d2df45a6b4 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,390 | supabase-export-v2 | 95f6735853b7fa12 | | ``date1 == date2`` | Equality comparison. (4) | | | ``date1 != date2`` | | +-------------------------------+----------------------------------------------+ | | ``date1 < date2`` | Order comparison.
(5) |
| | ``date1 > date2`` | |
| | ``date1 <= date2`` | |
| | ``date1 >= date2`` | |
+-------------------------------+-... | trusted_official_docs | CPython Docs | | ``date1 == date2`` | Equality comparison. (4) | | | ``date1 != date2`` | | +-------------------------------+----------------------------------------------+ | | ``date1 < date2`` | Order comparison.
(5) |
| | ``date1 > date2`` | |
| | ``date1 <= date2`` | |
| | ``date1 >= date2`` | |
+-------------------------------+-... | | ``date1 == date2`` | Equality comparison. (4) | | | ``date1 != date2`` | | +-------------------------------+----------------------------------------------+ | | ``date1 < date2`` | Order comparison.
(5) |
| | ``date1 > date2`` | |
| | ``date1 <= date2`` | |
| | ``date1 >= date2`` | |
+-------------------------------+-... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
41947ad9-b13b-4375-9d66-1d3e885b29a9 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,844 | supabase-export-v2 | 29b47bab1d06b2c0 | year that | 2014, ..., 9998, 9999 | | | | contains the greater part of | | | | | the ISO week (``%V``).
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%h`` | Equivalent to ``%b``. | See ``%b``. | \(0) |
+-----------+--------------------------------+------------------------+---... | trusted_official_docs | CPython Docs | year that | 2014, ..., 9998, 9999 | | | | contains the greater part of | | | | | the ISO week (``%V``).
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%h`` | Equivalent to ``%b``. | See ``%b``. | \(0) |
+-----------+--------------------------------+------------------------+---... | year that | 2014, ..., 9998, 9999 | | | | contains the greater part of | | | | | the ISO week (``%V``).
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%h`` | Equivalent to ``%b``. | See ``%b``. | \(0) |
+-----------+--------------------------------+------------------------+---... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
426995ee-ac41-4fdb-90d0-bafe699aec87 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,515 | supabase-export-v2 | 300b0843391cb7cb | .. classmethod:: datetime.fromisocalendar(year, week, day)
Return a :class:`.datetime` corresponding to the ISO calendar date specified
by *year*, *week* and *day*. The non-date components of the datetime are populated
with their normal default values. This is the inverse of the function
:meth:`datetime.isocalendar`... | trusted_official_docs | CPython Docs | .. classmethod:: datetime.fromisocalendar(year, week, day)
Return a :class:`.datetime` corresponding to the ISO calendar date specified
by *year*, *week* and *day*. The non-date components of the datetime are populated
with their normal default values. This is the inverse of the function
:meth:`datetime.isocalendar`... | .. classmethod:: datetime.fromisocalendar(year, week, day)
Return a :class:`.datetime` corresponding to the ISO calendar date specified
by *year*, *week* and *day*. The non-date components of the datetime are populated
with their normal default values. This is the inverse of the function
:meth:`datetime.isocalendar`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
42ebdd4e-fd9c-4f46-91cb-aa4e43bd5993 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,388 | supabase-export-v2 | 6c349cc2f0241089 | Supported operations:
+-------------------------------+----------------------------------------------+
| Operation | Result |
+===============================+==============================================+
| ``date2 = date1 + timedelta`` | ``date2`` will be ``timedelta.days`` days |
| | after ``date1``. (1) |
+-------... | trusted_official_docs | CPython Docs | Supported operations:
+-------------------------------+----------------------------------------------+
| Operation | Result |
+===============================+==============================================+
| ``date2 = date1 + timedelta`` | ``date2`` will be ``timedelta.days`` days |
| | after ``date1``. (1) |
+-------... | Supported operations:
+-------------------------------+----------------------------------------------+
| Operation | Result |
+===============================+==============================================+
| ``date2 = date1 + timedelta`` | ``date2`` will be ``timedelta.days`` days |
| | after ``date1``. (1) |
+-------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4300bd28-6b3f-4986-90bd-8f0cf2103192 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,843 | supabase-export-v2 | b25d5398be63b153 | | | space-padded decimal number. | | | +-----------+--------------------------------+------------------------+-------+ | ``%F`` | Equivalent to ``%Y-%m-%d``, | 2025-10-11, | | | | the ISO 8601 format.
| 1001-12-30 | |
+-----------+--------------------------------+------------------------+-------+
| ``%g`` | Last 2 digi... | trusted_official_docs | CPython Docs | | | space-padded decimal number. | | | +-----------+--------------------------------+------------------------+-------+ | ``%F`` | Equivalent to ``%Y-%m-%d``, | 2025-10-11, | | | | the ISO 8601 format.
| 1001-12-30 | |
+-----------+--------------------------------+------------------------+-------+
| ``%g`` | Last 2 digi... | | | space-padded decimal number. | | | +-----------+--------------------------------+------------------------+-------+ | ``%F`` | Equivalent to ``%Y-%m-%d``, | 2025-10-11, | | | | the ISO 8601 format.
| 1001-12-30 | |
+-----------+--------------------------------+------------------------+-------+
| ``%g`` | Last 2 digi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
43f7a3b2-f413-400d-8764-6f6dc037867a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,566 | supabase-export-v2 | 1519d4febd543c35 | Return :class:`.time` object with same hour, minute, second, microsecond and fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`.
.. versionchanged:: 3.6
The fold value is copied to the returned :class:`.time` object. | trusted_official_docs | CPython Docs | Return :class:`.time` object with same hour, minute, second, microsecond and fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`.
.. versionchanged:: 3.6
The fold value is copied to the returned :class:`.time` object. | Return :class:`.time` object with same hour, minute, second, microsecond and fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`.
.. versionchanged:: 3.6
The fold value is copied to the returned :class:`.time` object. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
452e3009-a108-4c5f-b4c0-840662420974 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,412 | supabase-export-v2 | 365347df4380c0b4 | time.struct_time((d.year, d.month, d.day, 0, 0, 0, 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. | trusted_official_docs | CPython Docs | time.struct_time((d.year, d.month, d.day, 0, 0, 0, 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. | time.struct_time((d.year, d.month, d.day, 0, 0, 0, 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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
45fb1e18-9634-48ed-ac92-9ae465f98f97 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,491 | supabase-export-v2 | a2990129ea236969 | supported by the platform C :c:func:`gmtime` function, and :exc:`OSError` on :c:func:`gmtime` failure. It's common for this to be restricted to years in 1970 through 2038.
To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`:: | trusted_official_docs | CPython Docs | supported by the platform C :c:func:`gmtime` function, and :exc:`OSError` on :c:func:`gmtime` failure. It's common for this to be restricted to years in 1970 through 2038.
To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`:: | supported by the platform C :c:func:`gmtime` function, and :exc:`OSError` on :c:func:`gmtime` failure. It's common for this to be restricted to years in 1970 through 2038.
To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
460629d1-b763-45e0-94af-b05db6ac7c0e | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,324 | supabase-export-v2 | 142d1c0e36fed34f | In addition to the operations listed above, :class:`timedelta` objects support certain additions and subtractions with :class:`date` and :class:`.datetime` objects (see below).
.. versionchanged:: 3.2
Floor division and true division of a :class:`timedelta` object by another
:class:`!timedelta` object are now support... | trusted_official_docs | CPython Docs | In addition to the operations listed above, :class:`timedelta` objects support certain additions and subtractions with :class:`date` and :class:`.datetime` objects (see below).
.. versionchanged:: 3.2
Floor division and true division of a :class:`timedelta` object by another
:class:`!timedelta` object are now support... | In addition to the operations listed above, :class:`timedelta` objects support certain additions and subtractions with :class:`date` and :class:`.datetime` objects (see below).
.. versionchanged:: 3.2
Floor division and true division of a :class:`timedelta` object by another
:class:`!timedelta` object are now support... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
461ba383-00ab-4b6e-aa75-e8621e9a6b74 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,719 | supabase-export-v2 | 0121ee2914582286 | Return a string representing the time in ISO 8601 format, one of:
- ``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0
- ``HH:MM:SS``, if :attr:`microsecond` is 0
- ``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not return ``None``
- ``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0... | trusted_official_docs | CPython Docs | Return a string representing the time in ISO 8601 format, one of:
- ``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0
- ``HH:MM:SS``, if :attr:`microsecond` is 0
- ``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not return ``None``
- ``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0... | Return a string representing the time in ISO 8601 format, one of:
- ``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0
- ``HH:MM:SS``, if :attr:`microsecond` is 0
- ``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not return ``None``
- ``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
469dcf91-1c70-4d83-86d2-b2b9b74da899 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,252 | supabase-export-v2 | 4ed44d2666148291 | .. class:: tzinfo :noindex:
An abstract base class for time zone information objects. These are used by the
:class:`.datetime` and :class:`.time` classes to provide a customizable notion of
time adjustment (for example, to account for time zone and/or daylight saving
time). | trusted_official_docs | CPython Docs | .. class:: tzinfo :noindex:
An abstract base class for time zone information objects. These are used by the
:class:`.datetime` and :class:`.time` classes to provide a customizable notion of
time adjustment (for example, to account for time zone and/or daylight saving
time). | .. class:: tzinfo :noindex:
An abstract base class for time zone information objects. These are used by the
:class:`.datetime` and :class:`.time` classes to provide a customizable notion of
time adjustment (for example, to account for time zone and/or daylight saving
time). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
46b2eb4d-2aa7-4f6e-a30b-07973749ea2f | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,830 | supabase-export-v2 | 06d15818da6ef645 | :class:`date`, :class:`.datetime`, and :class:`.time` objects all support a ``strftime(format)`` method, to create a string representing the time under the control of an explicit format string.
Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and
:meth:`time.strptime` class methods create an object from... | trusted_official_docs | CPython Docs | :class:`date`, :class:`.datetime`, and :class:`.time` objects all support a ``strftime(format)`` method, to create a string representing the time under the control of an explicit format string.
Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and
:meth:`time.strptime` class methods create an object from... | :class:`date`, :class:`.datetime`, and :class:`.time` objects all support a ``strftime(format)`` method, to create a string representing the time under the control of an explicit format string.
Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and
:meth:`time.strptime` class methods create an object from... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4846dff4-83c8-4aaa-b143-093b21ea4621 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,842 | supabase-export-v2 | 33c1764a5a8138de | a | 01, 02, ..., 31 | \(9), | | | zero-padded decimal number. | | \(10) | +-----------+--------------------------------+------------------------+-------+ | ``%D`` | Equivalent to ``%m/%d/%y``.
| 11/28/25 | \(9) |
| | | | |
+-----------+--------------------------------+------------------------+-------+
| ``%e`` | The da... | trusted_official_docs | CPython Docs | a | 01, 02, ..., 31 | \(9), | | | zero-padded decimal number. | | \(10) | +-----------+--------------------------------+------------------------+-------+ | ``%D`` | Equivalent to ``%m/%d/%y``.
| 11/28/25 | \(9) |
| | | | |
+-----------+--------------------------------+------------------------+-------+
| ``%e`` | The da... | a | 01, 02, ..., 31 | \(9), | | | zero-padded decimal number. | | \(10) | +-----------+--------------------------------+------------------------+-------+ | ``%D`` | Equivalent to ``%m/%d/%y``.
| 11/28/25 | \(9) |
| | | | |
+-----------+--------------------------------+------------------------+-------+
| ``%e`` | The da... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4885b8aa-5422-47e7-9899-79b698907ea3 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,727 | supabase-export-v2 | 50400783b9a93af4 | >>> import datetime as dt >>> dt.time(hour=12, minute=34, second=56, microsecond=123456).isoformat(timespec='minutes') '12:34' >>> my_time = dt.time(hour=12, minute=34, second=56, microsecond=0) >>> my_time.isoformat(timespec='microseconds') '12:34:56.000000' >>> my_time.isoformat(timespec='auto') '12:34:56'
.. version... | trusted_official_docs | CPython Docs | >>> import datetime as dt >>> dt.time(hour=12, minute=34, second=56, microsecond=123456).isoformat(timespec='minutes') '12:34' >>> my_time = dt.time(hour=12, minute=34, second=56, microsecond=0) >>> my_time.isoformat(timespec='microseconds') '12:34:56.000000' >>> my_time.isoformat(timespec='auto') '12:34:56'
.. version... | >>> import datetime as dt >>> dt.time(hour=12, minute=34, second=56, microsecond=123456).isoformat(timespec='minutes') '12:34' >>> my_time = dt.time(hour=12, minute=34, second=56, microsecond=0) >>> my_time.isoformat(timespec='microseconds') '12:34:56.000000' >>> my_time.isoformat(timespec='auto') '12:34:56'
.. version... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
49186294-4187-45aa-b5ab-751317ee93e6 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,879 | supabase-export-v2 | 00b0065fea64afd7 | be taken when making assumptions about the output value. Field orderings will vary (for example, "month/day/year" versus "day/month/year"), and the output may contain non-ASCII characters.
(2)
The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] range, but
years < 1000 must be zero-filled to 4... | trusted_official_docs | CPython Docs | be taken when making assumptions about the output value. Field orderings will vary (for example, "month/day/year" versus "day/month/year"), and the output may contain non-ASCII characters.
(2)
The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] range, but
years < 1000 must be zero-filled to 4... | be taken when making assumptions about the output value. Field orderings will vary (for example, "month/day/year" versus "day/month/year"), and the output may contain non-ASCII characters.
(2)
The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] range, but
years < 1000 must be zero-filled to 4... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4ae72c5e-0237-4fae-bd81-9e5fcd235a58 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,561 | supabase-export-v2 | d8d93a240b118a11 | .. versionchanged:: 3.3 Equality comparisons between aware and naive :class:`.datetime` instances don't raise :exc:`TypeError`.
.. versionchanged:: 3.13
Comparison between :class:`.datetime` object and an instance of
the :class:`date` subclass that is not a :class:`!datetime` subclass
no longer converts the latter t... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.3 Equality comparisons between aware and naive :class:`.datetime` instances don't raise :exc:`TypeError`.
.. versionchanged:: 3.13
Comparison between :class:`.datetime` object and an instance of
the :class:`date` subclass that is not a :class:`!datetime` subclass
no longer converts the latter t... | .. versionchanged:: 3.3 Equality comparisons between aware and naive :class:`.datetime` instances don't raise :exc:`TypeError`.
.. versionchanged:: 3.13
Comparison between :class:`.datetime` object and an instance of
the :class:`date` subclass that is not a :class:`!datetime` subclass
no longer converts the latter t... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4b1fdf06-f497-4432-89c2-ea65bce2d74a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,870 | supabase-export-v2 | 6b56db70cabeb1e7 | ... ValueError: day 29 must be in range 1..28 for month 2 in year 1900 >>> dt.datetime.strptime(f"1904 {value}", "%Y %m/%d") datetime.datetime(1904, 2, 29, 0, 0)
Using ``datetime.strptime(date_string, format)`` is equivalent to:: | trusted_official_docs | CPython Docs | ... ValueError: day 29 must be in range 1..28 for month 2 in year 1900 >>> dt.datetime.strptime(f"1904 {value}", "%Y %m/%d") datetime.datetime(1904, 2, 29, 0, 0)
Using ``datetime.strptime(date_string, format)`` is equivalent to:: | ... ValueError: day 29 must be in range 1..28 for month 2 in year 1900 >>> dt.datetime.strptime(f"1904 {value}", "%Y %m/%d") datetime.datetime(1904, 2, 29, 0, 0)
Using ``datetime.strptime(date_string, format)`` is equivalent to:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4cd98919-5afc-47d0-a53a-a5f932f857ee | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,470 | supabase-export-v2 | e4258534fdba35d4 | more precision than can be gotten from going through a :func:`time.time` timestamp (for example, this may be possible on platforms supplying the C :c:func:`gettimeofday` function).
If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass,
and the current date and time are converted to *tz*’s time ... | trusted_official_docs | CPython Docs | more precision than can be gotten from going through a :func:`time.time` timestamp (for example, this may be possible on platforms supplying the C :c:func:`gettimeofday` function).
If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass,
and the current date and time are converted to *tz*’s time ... | more precision than can be gotten from going through a :func:`time.time` timestamp (for example, this may be possible on platforms supplying the C :c:func:`gettimeofday` function).
If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass,
and the current date and time are converted to *tz*’s time ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4e5d6e7c-6278-467a-92cd-810e52d1f08c | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,588 | supabase-export-v2 | 3172d88a2e789f3b | .. method:: datetime.dst()
If :attr:`.tzinfo` is ``None``, returns ``None``, else returns
``self.tzinfo.dst(self)``, and raises an exception if the latter doesn't return
``None`` or a :class:`timedelta` object with magnitude less than one day. | trusted_official_docs | CPython Docs | .. method:: datetime.dst()
If :attr:`.tzinfo` is ``None``, returns ``None``, else returns
``self.tzinfo.dst(self)``, and raises an exception if the latter doesn't return
``None`` or a :class:`timedelta` object with magnitude less than one day. | .. method:: datetime.dst()
If :attr:`.tzinfo` is ``None``, returns ``None``, else returns
``self.tzinfo.dst(self)``, and raises an exception if the latter doesn't return
``None`` or a :class:`timedelta` object with magnitude less than one day. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4ee18341-4141-4702-a70e-3bb42eddd923 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,831 | supabase-export-v2 | 1df0d520a2b58187 | Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and :meth:`time.strptime` class methods create an object from a string representing the time and a corresponding format string.
The table below provides a high-level comparison of :meth:`~.datetime.strftime`
versus :meth:`~.datetime.strptime`: | trusted_official_docs | CPython Docs | Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and :meth:`time.strptime` class methods create an object from a string representing the time and a corresponding format string.
The table below provides a high-level comparison of :meth:`~.datetime.strftime`
versus :meth:`~.datetime.strptime`: | Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and :meth:`time.strptime` class methods create an object from a string representing the time and a corresponding format string.
The table below provides a high-level comparison of :meth:`~.datetime.strftime`
versus :meth:`~.datetime.strptime`: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4ef5b1fc-c591-43af-b899-61ee93107241 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,485 | supabase-export-v2 | bc7243b3ee5cdd9e | by :meth:`fromtimestamp`, and then it's possible to have two timestamps differing by a second that yield identical :class:`.datetime` objects. This method is preferred over :meth:`utcfromtimestamp`.
.. versionchanged:: 3.3
Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp
is out of the range of... | trusted_official_docs | CPython Docs | by :meth:`fromtimestamp`, and then it's possible to have two timestamps differing by a second that yield identical :class:`.datetime` objects. This method is preferred over :meth:`utcfromtimestamp`.
.. versionchanged:: 3.3
Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp
is out of the range of... | by :meth:`fromtimestamp`, and then it's possible to have two timestamps differing by a second that yield identical :class:`.datetime` objects. This method is preferred over :meth:`utcfromtimestamp`.
.. versionchanged:: 3.3
Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp
is out of the range of... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
50faf443-edd2-41e8-8f55-dfca6d24c779 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,478 | supabase-export-v2 | e7068e7de79cb7e8 | .. warning::
Because naive ``datetime`` objects are treated by many ``datetime`` methods
as local times, it is preferred to use aware datetimes to represent times
in UTC. As such, the recommended way to create an object representing the
current time in UTC is by calling ``datetime.now(timezone.utc)``. | trusted_official_docs | CPython Docs | .. warning::
Because naive ``datetime`` objects are treated by many ``datetime`` methods
as local times, it is preferred to use aware datetimes to represent times
in UTC. As such, the recommended way to create an object representing the
current time in UTC is by calling ``datetime.now(timezone.utc)``. | .. warning::
Because naive ``datetime`` objects are treated by many ``datetime`` methods
as local times, it is preferred to use aware datetimes to represent times
in UTC. As such, the recommended way to create an object representing the
current time in UTC is by calling ``datetime.now(timezone.utc)``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
51f70f85-be4a-4fef-a871-fcdbabf9edbb | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,815 | supabase-export-v2 | 1b5b6a9b751a4713 | The *dt* argument is ignored. The return value is a :class:`timedelta` instance equal to the difference between the local time and UTC.
.. versionchanged:: 3.7
The UTC offset is not restricted to a whole number of minutes. | trusted_official_docs | CPython Docs | The *dt* argument is ignored. The return value is a :class:`timedelta` instance equal to the difference between the local time and UTC.
.. versionchanged:: 3.7
The UTC offset is not restricted to a whole number of minutes. | The *dt* argument is ignored. The return value is a :class:`timedelta` instance equal to the difference between the local time and UTC.
.. versionchanged:: 3.7
The UTC offset is not restricted to a whole number of minutes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
52e17b6d-39fb-422c-adc1-696d294a4732 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,334 | supabase-export-v2 | bb44b30e96ff7dd8 | An additional example of normalization::
>>> # Components of another_year add up to exactly 365 days
>>> import datetime as dt
>>> year = dt.timedelta(days=365)
>>> another_year = dt.timedelta(weeks=40, days=84, hours=23,
... minutes=50, seconds=600)
>>> year == another_year
True
>>> year.total_seconds()
315360... | trusted_official_docs | CPython Docs | An additional example of normalization::
>>> # Components of another_year add up to exactly 365 days
>>> import datetime as dt
>>> year = dt.timedelta(days=365)
>>> another_year = dt.timedelta(weeks=40, days=84, hours=23,
... minutes=50, seconds=600)
>>> year == another_year
True
>>> year.total_seconds()
315360... | An additional example of normalization::
>>> # Components of another_year add up to exactly 365 days
>>> import datetime as dt
>>> year = dt.timedelta(days=365)
>>> another_year = dt.timedelta(weeks=40, days=84, hours=23,
... minutes=50, seconds=600)
>>> year == another_year
True
>>> year.total_seconds()
315360... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
535b4c3c-e1a0-47f9-afe5-c44022d57c96 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,353 | supabase-export-v2 | ba318eb2957a4c4c | if the timestamp is out of the range of values supported by the platform C :c:func:`localtime` function. Raise :exc:`OSError` instead of :exc:`ValueError` on :c:func:`localtime` failure.
.. versionchanged:: 3.15
Accepts any real number as *timestamp*, not only integer or float. | trusted_official_docs | CPython Docs | if the timestamp is out of the range of values supported by the platform C :c:func:`localtime` function. Raise :exc:`OSError` instead of :exc:`ValueError` on :c:func:`localtime` failure.
.. versionchanged:: 3.15
Accepts any real number as *timestamp*, not only integer or float. | if the timestamp is out of the range of values supported by the platform C :c:func:`localtime` function. Raise :exc:`OSError` instead of :exc:`ValueError` on :c:func:`localtime` failure.
.. versionchanged:: 3.15
Accepts any real number as *timestamp*, not only integer or float. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5719865c-5891-4939-a5af-e06e6bd4ba9a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,873 | supabase-export-v2 | 2ec39b9dd3502238 | except when the format includes sub-second components or time zone offset information, which are supported in ``datetime.strptime`` but are discarded by ``time.strptime``.
For :class:`.time` objects, the format codes for year, month, and day should not
be used, as :class:`!time` objects have no such values. If they're ... | trusted_official_docs | CPython Docs | except when the format includes sub-second components or time zone offset information, which are supported in ``datetime.strptime`` but are discarded by ``time.strptime``.
For :class:`.time` objects, the format codes for year, month, and day should not
be used, as :class:`!time` objects have no such values. If they're ... | except when the format includes sub-second components or time zone offset information, which are supported in ``datetime.strptime`` but are discarded by ``time.strptime``.
For :class:`.time` objects, the format codes for year, month, and day should not
be used, as :class:`!time` objects have no such values. If they're ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5745fa84-052d-429f-aafe-7d7916e804c7 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,750 | supabase-export-v2 | df9de1c727b173c9 | of local time from UTC, the name of the time zone, and DST offset, all relative to a date or time object passed to them.
You need to derive a concrete subclass, and (at least)
supply implementations of the standard :class:`tzinfo` methods needed by the
:class:`.datetime` methods you use. The :mod:`!datetime` module p... | trusted_official_docs | CPython Docs | of local time from UTC, the name of the time zone, and DST offset, all relative to a date or time object passed to them.
You need to derive a concrete subclass, and (at least)
supply implementations of the standard :class:`tzinfo` methods needed by the
:class:`.datetime` methods you use. The :mod:`!datetime` module p... | of local time from UTC, the name of the time zone, and DST offset, all relative to a date or time object passed to them.
You need to derive a concrete subclass, and (at least)
supply implementations of the standard :class:`tzinfo` methods needed by the
:class:`.datetime` methods you use. The :mod:`!datetime` module p... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
59e5d2f2-dd7b-42f8-9771-52d1079e2cc5 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,586 | supabase-export-v2 | 7746fbfa038e341c | returns ``None``, else returns ``self.tzinfo.utcoffset(self)``, and raises an exception if the latter doesn't return ``None`` or a :class:`timedelta` object with magnitude less than one day.
.. versionchanged:: 3.7
The UTC offset is not restricted to a whole number of minutes. | trusted_official_docs | CPython Docs | returns ``None``, else returns ``self.tzinfo.utcoffset(self)``, and raises an exception if the latter doesn't return ``None`` or a :class:`timedelta` object with magnitude less than one day.
.. versionchanged:: 3.7
The UTC offset is not restricted to a whole number of minutes. | returns ``None``, else returns ``self.tzinfo.utcoffset(self)``, and raises an exception if the latter doesn't return ``None`` or a :class:`timedelta` object with magnitude less than one day.
.. versionchanged:: 3.7
The UTC offset is not restricted to a whole number of minutes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5ab3a122-20ed-4ada-8454-330d6f69fb8a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,775 | supabase-export-v2 | f02b731932be8768 | .. method:: tzinfo.tzname(dt)
Return the time zone name corresponding to the :class:`.datetime` object *dt*, as
a string. Nothing about string names is defined by the :mod:`!datetime` module,
and there's no requirement that it mean anything in particular. For example,
``"GMT"``, ``"UTC"``, ``"-500"``, ``"-5:00"``, `... | trusted_official_docs | CPython Docs | .. method:: tzinfo.tzname(dt)
Return the time zone name corresponding to the :class:`.datetime` object *dt*, as
a string. Nothing about string names is defined by the :mod:`!datetime` module,
and there's no requirement that it mean anything in particular. For example,
``"GMT"``, ``"UTC"``, ``"-500"``, ``"-5:00"``, `... | .. method:: tzinfo.tzname(dt)
Return the time zone name corresponding to the :class:`.datetime` object *dt*, as
a string. Nothing about string names is defined by the :mod:`!datetime` module,
and there's no requirement that it mean anything in particular. For example,
``"GMT"``, ``"UTC"``, ``"-500"``, ``"-5:00"``, `... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5d30b1a4-ba67-4f21-9e66-5533f9226c90 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,512 | supabase-export-v2 | 622e95683cdae5bc | Examples::
>>> import datetime as dt
>>> dt.datetime.fromisoformat('2011-11-04')
datetime.datetime(2011, 11, 4, 0, 0)
>>> dt.datetime.fromisoformat('20111104')
datetime.datetime(2011, 11, 4, 0, 0)
>>> dt.datetime.fromisoformat('2011-11-04T00:05:23')
datetime.datetime(2011, 11, 4, 0, 5, 23)
>>> dt.datetime.fromis... | trusted_official_docs | CPython Docs | Examples::
>>> import datetime as dt
>>> dt.datetime.fromisoformat('2011-11-04')
datetime.datetime(2011, 11, 4, 0, 0)
>>> dt.datetime.fromisoformat('20111104')
datetime.datetime(2011, 11, 4, 0, 0)
>>> dt.datetime.fromisoformat('2011-11-04T00:05:23')
datetime.datetime(2011, 11, 4, 0, 5, 23)
>>> dt.datetime.fromis... | Examples::
>>> import datetime as dt
>>> dt.datetime.fromisoformat('2011-11-04')
datetime.datetime(2011, 11, 4, 0, 0)
>>> dt.datetime.fromisoformat('20111104')
datetime.datetime(2011, 11, 4, 0, 0)
>>> dt.datetime.fromisoformat('2011-11-04T00:05:23')
datetime.datetime(2011, 11, 4, 0, 5, 23)
>>> dt.datetime.fromis... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5d8c2135-3e53-4a49-98ab-d37280e8f0d2 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,766 | supabase-export-v2 | 99fadd364135a8f3 | it. If a :class:`!tzinfo` subclass cannot guarantee this, it may be able to override the default implementation of :meth:`tzinfo.fromutc` to work correctly with :meth:`~.datetime.astimezone` regardless.
Most implementations of :meth:`dst` will probably look like one of these two:: | trusted_official_docs | CPython Docs | it. If a :class:`!tzinfo` subclass cannot guarantee this, it may be able to override the default implementation of :meth:`tzinfo.fromutc` to work correctly with :meth:`~.datetime.astimezone` regardless.
Most implementations of :meth:`dst` will probably look like one of these two:: | it. If a :class:`!tzinfo` subclass cannot guarantee this, it may be able to override the default implementation of :meth:`tzinfo.fromutc` to work correctly with :meth:`~.datetime.astimezone` regardless.
Most implementations of :meth:`dst` will probably look like one of these two:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5e0a766d-fdff-4090-a2e2-f08fcb49ba35 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,598 | supabase-export-v2 | 7cd0fa6c68d51f81 | .. method:: datetime.utctimetuple()
If :class:`.datetime` instance ``d`` is naive, this is the same as
``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 regardless of what
``d.dst()`` returns. DST is never in effect for a UTC time. | trusted_official_docs | CPython Docs | .. method:: datetime.utctimetuple()
If :class:`.datetime` instance ``d`` is naive, this is the same as
``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 regardless of what
``d.dst()`` returns. DST is never in effect for a UTC time. | .. method:: datetime.utctimetuple()
If :class:`.datetime` instance ``d`` is naive, this is the same as
``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 regardless of what
``d.dst()`` returns. DST is never in effect for a UTC time. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5ea415aa-15ba-4c7a-8e90-4c68177134cf | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,888 | supabase-export-v2 | abc54bc82128dcce | is omitted when the offset is a whole number of minutes. For example, if :meth:`~.datetime.utcoffset` returns ``timedelta(hours=-3, minutes=-30)``, ``%z`` is replaced with the string ``'-0330'``.
.. versionchanged:: 3.7
The UTC offset is not restricted to a whole number of minutes. | trusted_official_docs | CPython Docs | is omitted when the offset is a whole number of minutes. For example, if :meth:`~.datetime.utcoffset` returns ``timedelta(hours=-3, minutes=-30)``, ``%z`` is replaced with the string ``'-0330'``.
.. versionchanged:: 3.7
The UTC offset is not restricted to a whole number of minutes. | is omitted when the offset is a whole number of minutes. For example, if :meth:`~.datetime.utcoffset` returns ``timedelta(hours=-3, minutes=-30)``, ``%z`` is replaced with the string ``'-0330'``.
.. versionchanged:: 3.7
The UTC offset is not restricted to a whole number of minutes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5eab1d1f-a4cb-44fd-bcef-a1b03d6b4a88 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,900 | supabase-export-v2 | 98767aa006d6b0f9 | the leading zero is optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, ``%W``, and ``%V``. Format ``%y`` does require a leading zero.
(10)
When parsing a month and day using :meth:`~.datetime.strptime`, always
include a year in the format. If the value you need to parse lacks a year,... | trusted_official_docs | CPython Docs | the leading zero is optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, ``%W``, and ``%V``. Format ``%y`` does require a leading zero.
(10)
When parsing a month and day using :meth:`~.datetime.strptime`, always
include a year in the format. If the value you need to parse lacks a year,... | the leading zero is optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, ``%W``, and ``%V``. Format ``%y`` does require a leading zero.
(10)
When parsing a month and day using :meth:`~.datetime.strptime`, always
include a year in the format. If the value you need to parse lacks a year,... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5fc3ffd9-e732-42c3-848d-3068d2ccbdb1 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,314 | supabase-export-v2 | 75e1a7d65a9c0f88 | and ``r`` is a | | | :class:`timedelta` object. | +--------------------------------+-----------------------------------------------+ | ``+t1`` | Returns a :class:`timedelta` object with the | | | same value.
(2) |
+--------------------------------+-----------------------------------------------+
| ``-t1`` | Equivalent ... | trusted_official_docs | CPython Docs | and ``r`` is a | | | :class:`timedelta` object. | +--------------------------------+-----------------------------------------------+ | ``+t1`` | Returns a :class:`timedelta` object with the | | | same value.
(2) |
+--------------------------------+-----------------------------------------------+
| ``-t1`` | Equivalent ... | and ``r`` is a | | | :class:`timedelta` object. | +--------------------------------+-----------------------------------------------+ | ``+t1`` | Returns a :class:`timedelta` object with the | | | same value.
(2) |
+--------------------------------+-----------------------------------------------+
| ``-t1`` | Equivalent ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6083394a-4a02-46b7-a5b3-d6eb6f0c3329 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,794 | supabase-export-v2 | 1c49acc9c6139e19 | ``astimezone(Eastern)`` won't deliver a result with ``hour == 2`` on the day DST begins. For example, at the Spring forward transition of 2016, we get::
>>> import datetime as dt
>>> from tzinfo_examples import HOUR, Eastern
>>> u0 = dt.datetime(2016, 3, 13, 5, tzinfo=dt.timezone.utc)
>>> for i in range(4):
... u =... | trusted_official_docs | CPython Docs | ``astimezone(Eastern)`` won't deliver a result with ``hour == 2`` on the day DST begins. For example, at the Spring forward transition of 2016, we get::
>>> import datetime as dt
>>> from tzinfo_examples import HOUR, Eastern
>>> u0 = dt.datetime(2016, 3, 13, 5, tzinfo=dt.timezone.utc)
>>> for i in range(4):
... u =... | ``astimezone(Eastern)`` won't deliver a result with ``hour == 2`` on the day DST begins. For example, at the Spring forward transition of 2016, we get::
>>> import datetime as dt
>>> from tzinfo_examples import HOUR, Eastern
>>> u0 = dt.datetime(2016, 3, 13, 5, tzinfo=dt.timezone.utc)
>>> for i in range(4):
... u =... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
60b9c789-92f5-41a8-851b-c5073e23bedb | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,692 | supabase-export-v2 | 94f6372841329474 | .. attribute:: time.fold
In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. (A
repeated interval occurs when clocks are rolled back at the end of daylight saving
time or when the UTC offset for the current zone is decreased for political reasons.)
The values 0 and 1 represent, respectively, t... | trusted_official_docs | CPython Docs | .. attribute:: time.fold
In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. (A
repeated interval occurs when clocks are rolled back at the end of daylight saving
time or when the UTC offset for the current zone is decreased for political reasons.)
The values 0 and 1 represent, respectively, t... | .. attribute:: time.fold
In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. (A
repeated interval occurs when clocks are rolled back at the end of daylight saving
time or when the UTC offset for the current zone is decreased for political reasons.)
The values 0 and 1 represent, respectively, t... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
60fcf79d-7377-40d9-98c2-28318f69e7e2 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,699 | supabase-export-v2 | 5133dd9b00cdf5a2 | In Boolean contexts, a :class:`.time` object is always considered to be true.
.. versionchanged:: 3.5
Before Python 3.5, a :class:`.time` object was considered to be false if it
represented midnight in UTC. This behavior was considered obscure and
error-prone and has been removed in Python 3.5. See :issue:`13936` fo... | trusted_official_docs | CPython Docs | In Boolean contexts, a :class:`.time` object is always considered to be true.
.. versionchanged:: 3.5
Before Python 3.5, a :class:`.time` object was considered to be false if it
represented midnight in UTC. This behavior was considered obscure and
error-prone and has been removed in Python 3.5. See :issue:`13936` fo... | In Boolean contexts, a :class:`.time` object is always considered to be true.
.. versionchanged:: 3.5
Before Python 3.5, a :class:`.time` object was considered to be false if it
represented midnight in UTC. This behavior was considered obscure and
error-prone and has been removed in Python 3.5. See :issue:`13936` fo... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
63b76e62-dbb9-4f5a-9d02-9b7a4ff37491 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,850 | supabase-export-v2 | 398a5c272db97370 | a decimal number, | 0, 1, ..., 6 | | | | where 0 is Sunday and 6 is | | | | | Saturday.
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%W`` | Week number of the year | 00, 01, ..., 53 | \(7), |
| | (Monday as the first day of | | \(9) |
| | the week) as a zero-padded | | |
| |... | trusted_official_docs | CPython Docs | a decimal number, | 0, 1, ..., 6 | | | | where 0 is Sunday and 6 is | | | | | Saturday.
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%W`` | Week number of the year | 00, 01, ..., 53 | \(7), |
| | (Monday as the first day of | | \(9) |
| | the week) as a zero-padded | | |
| |... | a decimal number, | 0, 1, ..., 6 | | | | where 0 is Sunday and 6 is | | | | | Saturday.
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%W`` | Week number of the year | 00, 01, ..., 53 | \(7), |
| | (Monday as the first day of | | \(9) |
| | the week) as a zero-padded | | |
| |... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
648c7816-a7a0-4136-bb90-c3f8c9c8d1d0 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,456 | supabase-export-v2 | 979b44f94d6dcd94 | .. class:: datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
The *year*, *month* and *day* arguments are required. *tzinfo* may be ``None``, or an
instance of a :class:`tzinfo` subclass. The remaining arguments must be integers
in the following ranges: | trusted_official_docs | CPython Docs | .. class:: datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
The *year*, *month* and *day* arguments are required. *tzinfo* may be ``None``, or an
instance of a :class:`tzinfo` subclass. The remaining arguments must be integers
in the following ranges: | .. class:: datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
The *year*, *month* and *day* arguments are required. *tzinfo* may be ``None``, or an
instance of a :class:`tzinfo` subclass. The remaining arguments must be integers
in the following ranges: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
64bbbff8-2617-4804-a279-3924edfb47d0 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,312 | supabase-export-v2 | e2a94adec789f943 | | object. | +--------------------------------+-----------------------------------------------+ | ``t1 = t2 / f or t1 = t2 / i`` | Delta divided by a float or an int.
The result|
| | is rounded to the nearest multiple of |
| | timedelta.resolution using round-half-to-even.|
+--------------------------------+------------... | trusted_official_docs | CPython Docs | | object. | +--------------------------------+-----------------------------------------------+ | ``t1 = t2 / f or t1 = t2 / i`` | Delta divided by a float or an int.
The result|
| | is rounded to the nearest multiple of |
| | timedelta.resolution using round-half-to-even.|
+--------------------------------+------------... | | object. | +--------------------------------+-----------------------------------------------+ | ``t1 = t2 / f or t1 = t2 / i`` | Delta divided by a float or an int.
The result|
| | is rounded to the nearest multiple of |
| | timedelta.resolution using round-half-to-even.|
+--------------------------------+------------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6640e3dc-a976-4bb0-a889-b0e123be76ea | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,711 | supabase-export-v2 | 440a4a023499f6e9 | time(*(time.strptime(date_string, format)[3:6]))
:exc:`ValueError` is raised if the *date_string* and *format*
cannot be parsed by :func:`time.strptime` or if it returns a value which is not a
time tuple. See also :ref:`strftime-strptime-behavior` and
:meth:`time.fromisoformat`. | trusted_official_docs | CPython Docs | time(*(time.strptime(date_string, format)[3:6]))
:exc:`ValueError` is raised if the *date_string* and *format*
cannot be parsed by :func:`time.strptime` or if it returns a value which is not a
time tuple. See also :ref:`strftime-strptime-behavior` and
:meth:`time.fromisoformat`. | time(*(time.strptime(date_string, format)[3:6]))
:exc:`ValueError` is raised if the *date_string* and *format*
cannot be parsed by :func:`time.strptime` or if it returns a value which is not a
time tuple. See also :ref:`strftime-strptime-behavior` and
:meth:`time.fromisoformat`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6681aecf-bc77-49f7-9607-06adcf69d992 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,344 | supabase-export-v2 | fbc46073bc28f11b | ``MINYEAR <= year <= MAXYEAR`` * ``1 <= month <= 12`` * ``1 <= day <= number of days in the given month and year``
If an argument outside those ranges is given, :exc:`ValueError` is raised. | trusted_official_docs | CPython Docs | ``MINYEAR <= year <= MAXYEAR`` * ``1 <= month <= 12`` * ``1 <= day <= number of days in the given month and year``
If an argument outside those ranges is given, :exc:`ValueError` is raised. | ``MINYEAR <= year <= MAXYEAR`` * ``1 <= month <= 12`` * ``1 <= day <= number of days in the given month and year``
If an argument outside those ranges is given, :exc:`ValueError` is raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
66cdec76-846e-4fda-8a49-9ee1e6891a5a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,783 | supabase-export-v2 | c9382a9984f92d07 | as expressing a UTC time. The purpose of :meth:`fromutc` is to adjust the date and time data, returning an equivalent datetime in *self*'s local time.
Most :class:`tzinfo` subclasses should be able to inherit the default
:meth:`fromutc` implementation without problems. It's strong enough to handle
fixed-offset time z... | trusted_official_docs | CPython Docs | as expressing a UTC time. The purpose of :meth:`fromutc` is to adjust the date and time data, returning an equivalent datetime in *self*'s local time.
Most :class:`tzinfo` subclasses should be able to inherit the default
:meth:`fromutc` implementation without problems. It's strong enough to handle
fixed-offset time z... | as expressing a UTC time. The purpose of :meth:`fromutc` is to adjust the date and time data, returning an equivalent datetime in *self*'s local time.
Most :class:`tzinfo` subclasses should be able to inherit the default
:meth:`fromutc` implementation without problems. It's strong enough to handle
fixed-offset time z... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
670b79a6-3f31-416a-ade7-ce53b98eca52 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,840 | supabase-export-v2 | 7cbd13701dddf3c8 | | | | || Jan, Feb, ..., Dez | | | | | (de_DE) | | +-----------+--------------------------------+------------------------+-------+ | ``%B`` | Month as locale's full name.
|| January, February, | \(1) |
| | | ..., December (en_US);| |
| | || Januar, Februar, ..., | |
| | | Dezember (de_DE) | |
+-----------+--------------... | trusted_official_docs | CPython Docs | | | | || Jan, Feb, ..., Dez | | | | | (de_DE) | | +-----------+--------------------------------+------------------------+-------+ | ``%B`` | Month as locale's full name.
|| January, February, | \(1) |
| | | ..., December (en_US);| |
| | || Januar, Februar, ..., | |
| | | Dezember (de_DE) | |
+-----------+--------------... | | | | || Jan, Feb, ..., Dez | | | | | (de_DE) | | +-----------+--------------------------------+------------------------+-------+ | ``%B`` | Month as locale's full name.
|| January, February, | \(1) |
| | | ..., December (en_US);| |
| | || Januar, Februar, ..., | |
| | | Dezember (de_DE) | |
+-----------+--------------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
67797ec4-c01e-4624-9dc0-d8f2545a5e8a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,878 | supabase-export-v2 | 315d0c3847aeb2be | (0) This format code is currently unsupported by :meth:`~.datetime.strptime`.
(1)
Because the format depends on the current locale, care should be taken when
making assumptions about the output value. Field orderings will vary (for
example, "month/day/year" versus "day/month/year"), and the output may
contain non-A... | trusted_official_docs | CPython Docs | (0) This format code is currently unsupported by :meth:`~.datetime.strptime`.
(1)
Because the format depends on the current locale, care should be taken when
making assumptions about the output value. Field orderings will vary (for
example, "month/day/year" versus "day/month/year"), and the output may
contain non-A... | (0) This format code is currently unsupported by :meth:`~.datetime.strptime`.
(1)
Because the format depends on the current locale, care should be taken when
making assumptions about the output value. Field orderings will vary (for
example, "month/day/year" versus "day/month/year"), and the output may
contain non-A... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
67f27f7b-06bb-4f33-835b-e9102522b46f | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,889 | supabase-export-v2 | c4f7bc761099b007 | .. versionchanged:: 3.7 The UTC offset is not restricted to a whole number of minutes.
.. versionchanged:: 3.7
When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` method,
the UTC offsets can have a colon as a separator between hours, minutes
and seconds. For example, both ``'+010000'`` and ``'+0... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.7 The UTC offset is not restricted to a whole number of minutes.
.. versionchanged:: 3.7
When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` method,
the UTC offsets can have a colon as a separator between hours, minutes
and seconds. For example, both ``'+010000'`` and ``'+0... | .. versionchanged:: 3.7 The UTC offset is not restricted to a whole number of minutes.
.. versionchanged:: 3.7
When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` method,
the UTC offsets can have a colon as a separator between hours, minutes
and seconds. For example, both ``'+010000'`` and ``'+0... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
69c13817-a5ef-4e5f-b2a2-20a606cf8c25 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,846 | supabase-export-v2 | bc3a57216657c5c4 | newline character | ``\n`` | | | | (``'\n'``). For | | | | | :meth:`!strptime`, zero or | | | | | more whitespace.
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%p`` | Locale's equivalent of either || AM, PM (en_US); | \(1), |
| | AM or PM. || am, pm (de_DE) | \(3) |
+-------... | trusted_official_docs | CPython Docs | newline character | ``\n`` | | | | (``'\n'``). For | | | | | :meth:`!strptime`, zero or | | | | | more whitespace.
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%p`` | Locale's equivalent of either || AM, PM (en_US); | \(1), |
| | AM or PM. || am, pm (de_DE) | \(3) |
+-------... | newline character | ``\n`` | | | | (``'\n'``). For | | | | | :meth:`!strptime`, zero or | | | | | more whitespace.
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%p`` | Locale's equivalent of either || AM, PM (en_US); | \(1), |
| | AM or PM. || am, pm (de_DE) | \(3) |
+-------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
69ee2436-b493-4903-a5e9-164c9e666491 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,585 | supabase-export-v2 | e3d2a6f10ef06aad | .. method:: datetime.utcoffset()
If :attr:`.tzinfo` is ``None``, returns ``None``, else returns
``self.tzinfo.utcoffset(self)``, and raises an exception if the latter doesn't
return ``None`` or a :class:`timedelta` object with magnitude less than one day. | trusted_official_docs | CPython Docs | .. method:: datetime.utcoffset()
If :attr:`.tzinfo` is ``None``, returns ``None``, else returns
``self.tzinfo.utcoffset(self)``, and raises an exception if the latter doesn't
return ``None`` or a :class:`timedelta` object with magnitude less than one day. | .. method:: datetime.utcoffset()
If :attr:`.tzinfo` is ``None``, returns ``None``, else returns
``self.tzinfo.utcoffset(self)``, and raises an exception if the latter doesn't
return ``None`` or a :class:`timedelta` object with magnitude less than one day. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6ad73d54-5701-46c5-bbf7-a4b19b27f43e | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,323 | supabase-export-v2 | 9eed549ae7913f67 | expression ``t2 + (-t3)`` except when t3 is equal to ``timedelta.max``; in that case the former will produce a result while the latter will overflow.
In addition to the operations listed above, :class:`timedelta` objects support
certain additions and subtractions with :class:`date` and :class:`.datetime`
objects (see b... | trusted_official_docs | CPython Docs | expression ``t2 + (-t3)`` except when t3 is equal to ``timedelta.max``; in that case the former will produce a result while the latter will overflow.
In addition to the operations listed above, :class:`timedelta` objects support
certain additions and subtractions with :class:`date` and :class:`.datetime`
objects (see b... | expression ``t2 + (-t3)`` except when t3 is equal to ``timedelta.max``; in that case the former will produce a result while the latter will overflow.
In addition to the operations listed above, :class:`timedelta` objects support
certain additions and subtractions with :class:`date` and :class:`.datetime`
objects (see b... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6b21e29e-5a46-464a-956c-152685bfdb34 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,581 | supabase-export-v2 | 71fe58a92f83bd29 | that the default :meth:`tzinfo.fromutc` method can be overridden in a :class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. Ignoring error cases, :meth:`astimezone` acts like::
def astimezone(self, tz):
if self.tzinfo is tz:
return self
# Convert self to UTC, and attach the new timezone objec... | trusted_official_docs | CPython Docs | that the default :meth:`tzinfo.fromutc` method can be overridden in a :class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. Ignoring error cases, :meth:`astimezone` acts like::
def astimezone(self, tz):
if self.tzinfo is tz:
return self
# Convert self to UTC, and attach the new timezone objec... | that the default :meth:`tzinfo.fromutc` method can be overridden in a :class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. Ignoring error cases, :meth:`astimezone` acts like::
def astimezone(self, tz):
if self.tzinfo is tz:
return self
# Convert self to UTC, and attach the new timezone objec... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6b2e59e7-31cf-4d73-85ca-4544d849b6d1 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,424 | supabase-export-v2 | 0265e752ad4305da | begins on a Thursday, so the first week of ISO year 2004 begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::
>>> import datetime as dt
>>> dt.date(2003, 12, 29).isocalendar()
datetime.IsoCalendarDate(year=2004, week=1, weekday=1)
>>> dt.date(2004, 1, 4).isocalendar()
datetime.IsoCalendarDate(year=2004, w... | trusted_official_docs | CPython Docs | begins on a Thursday, so the first week of ISO year 2004 begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::
>>> import datetime as dt
>>> dt.date(2003, 12, 29).isocalendar()
datetime.IsoCalendarDate(year=2004, week=1, weekday=1)
>>> dt.date(2004, 1, 4).isocalendar()
datetime.IsoCalendarDate(year=2004, w... | begins on a Thursday, so the first week of ISO year 2004 begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::
>>> import datetime as dt
>>> dt.date(2003, 12, 29).isocalendar()
datetime.IsoCalendarDate(year=2004, week=1, weekday=1)
>>> dt.date(2004, 1, 4).isocalendar()
datetime.IsoCalendarDate(year=2004, w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6b70a9f0-e8a2-490e-9490-8dbfb695459f | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,797 | supabase-export-v2 | 6daa5d286a5bd674 | ... 04:00:00 UTC = 00:00:00 EDT 0 05:00:00 UTC = 01:00:00 EDT 0 06:00:00 UTC = 01:00:00 EST 1 07:00:00 UTC = 02:00:00 EST 0
Note that the :class:`.datetime` instances that differ only by the value of the
:attr:`~.datetime.fold` attribute are considered equal in comparisons. | trusted_official_docs | CPython Docs | ... 04:00:00 UTC = 00:00:00 EDT 0 05:00:00 UTC = 01:00:00 EDT 0 06:00:00 UTC = 01:00:00 EST 1 07:00:00 UTC = 02:00:00 EST 0
Note that the :class:`.datetime` instances that differ only by the value of the
:attr:`~.datetime.fold` attribute are considered equal in comparisons. | ... 04:00:00 UTC = 00:00:00 EDT 0 05:00:00 UTC = 01:00:00 EDT 0 06:00:00 UTC = 01:00:00 EST 1 07:00:00 UTC = 02:00:00 EST 0
Note that the :class:`.datetime` instances that differ only by the value of the
:attr:`~.datetime.fold` attribute are considered equal in comparisons. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6cae60ba-91ab-47d6-8399-e075eec4eb19 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,601 | supabase-export-v2 | 74a8d85a61e003cf | .. warning::
Because naive ``datetime`` objects are treated by many ``datetime`` methods
as local times, it is preferred to use aware datetimes to represent times
in UTC; as a result, using :meth:`datetime.utctimetuple` may give misleading
results. If you have a naive ``datetime`` representing UTC, use
``datetime.r... | trusted_official_docs | CPython Docs | .. warning::
Because naive ``datetime`` objects are treated by many ``datetime`` methods
as local times, it is preferred to use aware datetimes to represent times
in UTC; as a result, using :meth:`datetime.utctimetuple` may give misleading
results. If you have a naive ``datetime`` representing UTC, use
``datetime.r... | .. warning::
Because naive ``datetime`` objects are treated by many ``datetime`` methods
as local times, it is preferred to use aware datetimes to represent times
in UTC; as a result, using :meth:`datetime.utctimetuple` may give misleading
results. If you have a naive ``datetime`` representing UTC, use
``datetime.r... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6cfd144f-c62b-440f-89da-2588d5752d9a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,278 | supabase-export-v2 | 4d3dcd5a68742b07 | Only *days*, *seconds* and *microseconds* are stored internally. Arguments are converted to those units:
* A millisecond is converted to 1000 microseconds. * A minute is converted to 60 seconds. * An hour is converted to 3600 seconds. * A week is converted to 7 days. | trusted_official_docs | CPython Docs | Only *days*, *seconds* and *microseconds* are stored internally. Arguments are converted to those units:
* A millisecond is converted to 1000 microseconds. * A minute is converted to 60 seconds. * An hour is converted to 3600 seconds. * A week is converted to 7 days. | Only *days*, *seconds* and *microseconds* are stored internally. Arguments are converted to those units:
* A millisecond is converted to 1000 microseconds. * A minute is converted to 60 seconds. * An hour is converted to 3600 seconds. * A week is converted to 7 days. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6ee00721-e6d8-44ca-8663-b42e35a673b9 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,672 | supabase-export-v2 | b5463e7162c5cd21 | >>> # Datetime before the change >>> dt1 = dt.datetime(1900, 11, 21, 16, 30, tzinfo=tz1) >>> print(dt1.utcoffset()) 4:00:00
>>> # Datetime after the change
>>> dt2 = dt.datetime(2006, 6, 14, 13, 0, tzinfo=tz1)
>>> print(dt2.utcoffset())
4:30:00 | trusted_official_docs | CPython Docs | >>> # Datetime before the change >>> dt1 = dt.datetime(1900, 11, 21, 16, 30, tzinfo=tz1) >>> print(dt1.utcoffset()) 4:00:00
>>> # Datetime after the change
>>> dt2 = dt.datetime(2006, 6, 14, 13, 0, tzinfo=tz1)
>>> print(dt2.utcoffset())
4:30:00 | >>> # Datetime before the change >>> dt1 = dt.datetime(1900, 11, 21, 16, 30, tzinfo=tz1) >>> print(dt1.utcoffset()) 4:00:00
>>> # Datetime after the change
>>> dt2 = dt.datetime(2006, 6, 14, 13, 0, tzinfo=tz1)
>>> print(dt2.utcoffset())
4:30:00 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6f4a35d7-bfdc-421b-8754-6d7f62ef0b7c | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,469 | supabase-export-v2 | 97cf3a35759281b0 | Return the current local date and time.
If optional argument *tz* is ``None``
or not specified, this is like :meth:`today`, but, if possible, supplies more
precision than can be gotten from going through a :func:`time.time` timestamp
(for example, this may be possible on platforms supplying the C
:c:func:`gettimeof... | trusted_official_docs | CPython Docs | Return the current local date and time.
If optional argument *tz* is ``None``
or not specified, this is like :meth:`today`, but, if possible, supplies more
precision than can be gotten from going through a :func:`time.time` timestamp
(for example, this may be possible on platforms supplying the C
:c:func:`gettimeof... | Return the current local date and time.
If optional argument *tz* is ``None``
or not specified, this is like :meth:`today`, but, if possible, supplies more
precision than can be gotten from going through a :func:`time.time` timestamp
(for example, this may be possible on platforms supplying the C
:c:func:`gettimeof... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7137ffd7-9c44-47ab-ba91-0caac64d463e | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,855 | supabase-export-v2 | 79cd7920e37575e4 | Several additional directives not required by the C11 standard are included for convenience.
+-----------+--------------------------------+------------------------+-------+
| Directive | Meaning | Example | Notes |
+===========+================================+========================+=======+
| ``%f`` | Microsecond as... | trusted_official_docs | CPython Docs | Several additional directives not required by the C11 standard are included for convenience.
+-----------+--------------------------------+------------------------+-------+
| Directive | Meaning | Example | Notes |
+===========+================================+========================+=======+
| ``%f`` | Microsecond as... | Several additional directives not required by the C11 standard are included for convenience.
+-----------+--------------------------------+------------------------+-------+
| Directive | Meaning | Example | Notes |
+===========+================================+========================+=======+
| ``%f`` | Microsecond as... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7397db2a-32af-4fef-a417-78e9d97f395f | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,231 | supabase-export-v2 | 9347f56f21ec0843 | number represents metres, miles, or mass. Naive objects are easy to understand and to work with, at the cost of ignoring some aspects of reality.
For applications requiring aware objects, :class:`.datetime` and :class:`.time`
objects have an optional time zone information attribute, :attr:`!tzinfo`, that
can be set to ... | trusted_official_docs | CPython Docs | number represents metres, miles, or mass. Naive objects are easy to understand and to work with, at the cost of ignoring some aspects of reality.
For applications requiring aware objects, :class:`.datetime` and :class:`.time`
objects have an optional time zone information attribute, :attr:`!tzinfo`, that
can be set to ... | number represents metres, miles, or mass. Naive objects are easy to understand and to work with, at the cost of ignoring some aspects of reality.
For applications requiring aware objects, :class:`.datetime` and :class:`.time`
objects have an optional time zone information attribute, :attr:`!tzinfo`, that
can be set to ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
749ad130-9d06-4a00-8767-bcbfb82f2970 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,400 | supabase-export-v2 | 0e5e47ce5b484e5e | latter to :class:`!date`, ignoring the time part and the time zone. The default behavior can be changed by overriding the special comparison methods in subclasses.
In Boolean contexts, all :class:`date` objects are considered to be true. | trusted_official_docs | CPython Docs | latter to :class:`!date`, ignoring the time part and the time zone. The default behavior can be changed by overriding the special comparison methods in subclasses.
In Boolean contexts, all :class:`date` objects are considered to be true. | latter to :class:`!date`, ignoring the time part and the time zone. The default behavior can be changed by overriding the special comparison methods in subclasses.
In Boolean contexts, all :class:`date` objects are considered to be true. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
74dca71b-2513-4524-b1b6-7c436277502a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,552 | supabase-export-v2 | eb815dffca45357a | is defined only if both operands are naive, or if both are aware. If one is aware and the other is naive, :exc:`TypeError` is raised.
If both are naive, or both are aware and have the same :attr:`~.datetime.tzinfo` attribute,
the :attr:`~.datetime.tzinfo` attributes are ignored, and the result is a :class:`timedelta`
... | trusted_official_docs | CPython Docs | is defined only if both operands are naive, or if both are aware. If one is aware and the other is naive, :exc:`TypeError` is raised.
If both are naive, or both are aware and have the same :attr:`~.datetime.tzinfo` attribute,
the :attr:`~.datetime.tzinfo` attributes are ignored, and the result is a :class:`timedelta`
... | is defined only if both operands are naive, or if both are aware. If one is aware and the other is naive, :exc:`TypeError` is raised.
If both are naive, or both are aware and have the same :attr:`~.datetime.tzinfo` attribute,
the :attr:`~.datetime.tzinfo` attributes are ignored, and the result is a :class:`timedelta`
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
763652b0-d3e0-46a6-bba0-d2e101eb80fa | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,423 | supabase-export-v2 | c267b41c9d9ebe17 | a year containing a Thursday. This is called week number 1, and the ISO year of that Thursday is the same as its Gregorian year.
For example, 2004 begins on a Thursday, so the first week of ISO year 2004
begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004:: | trusted_official_docs | CPython Docs | a year containing a Thursday. This is called week number 1, and the ISO year of that Thursday is the same as its Gregorian year.
For example, 2004 begins on a Thursday, so the first week of ISO year 2004
begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004:: | a year containing a Thursday. This is called week number 1, and the ISO year of that Thursday is the same as its Gregorian year.
For example, 2004 begins on a Thursday, so the first week of ISO year 2004
begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
76bf2ebe-dc0a-4462-abd6-0932bfebfd5f | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,554 | supabase-export-v2 | 0cc5ba24a8f65229 | and ``b`` were first converted to naive UTC datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None) - b.utcoffset())`` except that the implementation never overflows.
(4)
:class:`.datetime` objects are equal if they represent the same date
and time, taking into account the time z... | trusted_official_docs | CPython Docs | and ``b`` were first converted to naive UTC datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None) - b.utcoffset())`` except that the implementation never overflows.
(4)
:class:`.datetime` objects are equal if they represent the same date
and time, taking into account the time z... | and ``b`` were first converted to naive UTC datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None) - b.utcoffset())`` except that the implementation never overflows.
(4)
:class:`.datetime` objects are equal if they represent the same date
and time, taking into account the time z... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
798b7e43-8167-4915-a5ed-8b70491c970b | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,673 | supabase-export-v2 | be716c2d6d19d2c0 | >>> # Datetime after the change >>> dt2 = dt.datetime(2006, 6, 14, 13, 0, tzinfo=tz1) >>> print(dt2.utcoffset()) 4:30:00
>>> # Convert datetime to another time zone
>>> dt3 = dt2.astimezone(dt.timezone.utc)
>>> dt3
datetime.datetime(2006, 6, 14, 8, 30, tzinfo=datetime.timezone.utc)
>>> dt2
datetime.datetime(2006, ... | trusted_official_docs | CPython Docs | >>> # Datetime after the change >>> dt2 = dt.datetime(2006, 6, 14, 13, 0, tzinfo=tz1) >>> print(dt2.utcoffset()) 4:30:00
>>> # Convert datetime to another time zone
>>> dt3 = dt2.astimezone(dt.timezone.utc)
>>> dt3
datetime.datetime(2006, 6, 14, 8, 30, tzinfo=datetime.timezone.utc)
>>> dt2
datetime.datetime(2006, ... | >>> # Datetime after the change >>> dt2 = dt.datetime(2006, 6, 14, 13, 0, tzinfo=tz1) >>> print(dt2.utcoffset()) 4:30:00
>>> # Convert datetime to another time zone
>>> dt3 = dt2.astimezone(dt.timezone.utc)
>>> dt3
datetime.datetime(2006, 6, 14, 8, 30, tzinfo=datetime.timezone.utc)
>>> dt2
datetime.datetime(2006, ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7ad40c7a-a633-4541-b7b0-43348a35f228 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,443 | supabase-export-v2 | 35d0abc7fc7510ef | Example of counting days to an event::
>>> import time
>>> import datetime as dt
>>> today = dt.date.today()
>>> today
datetime.date(2007, 12, 5)
>>> today == dt.date.fromtimestamp(time.time())
True
>>> my_birthday = dt.date(today.year, 6, 24)
>>> if my_birthday < today:
... my_birthday = my_birthday.replace(y... | trusted_official_docs | CPython Docs | Example of counting days to an event::
>>> import time
>>> import datetime as dt
>>> today = dt.date.today()
>>> today
datetime.date(2007, 12, 5)
>>> today == dt.date.fromtimestamp(time.time())
True
>>> my_birthday = dt.date(today.year, 6, 24)
>>> if my_birthday < today:
... my_birthday = my_birthday.replace(y... | Example of counting days to an event::
>>> import time
>>> import datetime as dt
>>> today = dt.date.today()
>>> today
datetime.date(2007, 12, 5)
>>> today == dt.date.fromtimestamp(time.time())
True
>>> my_birthday = dt.date(today.year, 6, 24)
>>> if my_birthday < today:
... my_birthday = my_birthday.replace(y... | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.