@@ -1005,6 +1005,12 @@ msgid ""
10051005" the comparison is ``==`` or ``!=``. The latter cases return :const:`False` "
10061006"or :const:`True`, respectively."
10071007msgstr ""
1008+ "换句话说,当且仅当 ``date1.toordinal() < date2.toordinal()`` 时 ``date1 < date2``。 "
1009+ "日期比较在比较的目标不为 :class:`date` 对象时会引发 :exc:`TypeError`。 不过,如果比较的目标具有 "
1010+ ":attr:`~date.timetuple` 属性则将返回 ``NotImplemented``。 "
1011+ "这个钩子给予其他日期对象类型实现混合类型比较的机会。 否则,当 :class:`date` 对象与不同类型的对象比较时将会引发 "
1012+ ":exc:`TypeError`,除非是 ``==`` 或 ``!=`` 比较。 后两种情况将分别返回 :const:`False` 或 "
1013+ ":const:`True`。"
10081014
10091015#: ../../library/datetime.rst:648
10101016msgid ""
@@ -1705,6 +1711,11 @@ msgid ""
17051711"or ``!=``. The latter cases return :const:`False` or :const:`True`, "
17061712"respectively."
17071713msgstr ""
1714+ "为了防止比较操作回退为默认的对象地址比较方式,datetime 比较在比较的目标不为 :class:`.datetime` 对象时通常会引发 "
1715+ ":exc:`TypeError`。 不过,如果比较的目标具有 :attr:`~.datetime.timetuple` 属性则将返回 "
1716+ "``NotImplemented``。 这个钩子给予其他种类的日期对象实现混合类型比较的机会。 如果未实现,则当 :class:`.datetime` "
1717+ "对象与不同类型比较时将会引发 :exc:`TypeError`,除非是 ``==`` 或 ``!=`` 比较。 后两种情况将分别返回 "
1718+ ":const:`False` 或 :const:`True`。"
17081719
17091720#: ../../library/datetime.rst:1237
17101721msgid "Return :class:`date` object with same year, month and day."
@@ -1862,6 +1873,11 @@ msgid ""
18621873"non-zero value, :attr:`!tm_isdst` is set to ``1``; else :attr:`!tm_isdst` is"
18631874" set to ``0``."
18641875msgstr ""
1876+ "其中 ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` "
1877+ "是日期在当前年份中的序号,起始序号 ``1`` 表示 1月 1 日。 结果的 :attr:`~time.struct_time.tm_isdst` "
1878+ "旗标会根据 :meth:`dst` 方法来设定:如果 :attr:`.tzinfo` 为 ``None`` 或 :meth:`dst` 返回 "
1879+ "``None``,则 :attr:`!tm_isdst` 将设为 ``-1``;否则如果 :meth:`dst` 返回一个非零值则 "
1880+ ":attr:`!tm_isdst` 将设为 ``1``;在其他情况下 :attr:`!tm_isdst` 将设为 ``0``。"
18651881
18661882#: ../../library/datetime.rst:1365
18671883msgid ""
@@ -1870,6 +1886,9 @@ msgid ""
18701886"to 0 regardless of what ``d.dst()`` returns. DST is never in effect for a "
18711887"UTC time."
18721888msgstr ""
1889+ "如果 :class:`.datetime` 实例 *d* 为简单型,这类似于 ``d.timetuple()``,区别是 "
1890+ ":attr:`~.time.struct_time.tm_isdst` 会强制设为 0 而不管 ``d.dst()`` 返回什么结果。 DST 对于 "
1891+ "UTC 时间永远无效。"
18731892
18741893#: ../../library/datetime.rst:1369
18751894msgid ""
@@ -1879,6 +1898,9 @@ msgid ""
18791898":exc:`OverflowError` may be raised if *d*.year was ``MINYEAR`` or "
18801899"``MAXYEAR`` and UTC adjustment spills over a year boundary."
18811900msgstr ""
1901+ "如果 *d* 为感知型,*d* 会通过减去 ``d.utcoffset()`` 来标准化为 UTC 时间,并返回该标准化时间所对应的 "
1902+ ":class:`time.struct_time`。 :attr:`!tm_isdst` 将强制设为 0。 请注意如果 *d*.year 为 "
1903+ "``MINYEAR`` 或 ``MAXYEAR`` 并且 UTC 调整超出一年的边界则可能引发 :exc:`OverflowError`。"
18821904
18831905#: ../../library/datetime.rst:1378
18841906msgid ""
@@ -2116,7 +2138,7 @@ msgstr "用法示例: :class:`.datetime`"
21162138
21172139#: ../../library/datetime.rst:1559
21182140msgid "Examples of working with :class:`.datetime` objects:"
2119- msgstr ""
2141+ msgstr "使用 :class:`.datetime` 对象的例子: "
21202142
21212143#: ../../library/datetime.rst:1612
21222144msgid ""
@@ -2140,6 +2162,7 @@ msgid ""
21402162"A :class:`.time` object represents a (local) time of day, independent of any"
21412163" particular day, and subject to adjustment via a :class:`tzinfo` object."
21422164msgstr ""
2165+ "一个 :class:`.time` 对象代表某日的(本地)时间,它独立于任何特定日期,并可通过 :class:`tzinfo` 对象来调整。"
21432166
21442167#: ../../library/datetime.rst:1692
21452168msgid ""
@@ -2679,6 +2702,8 @@ msgid ""
26792702"handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` "
26802703"attribute (a UTC timezone instance)."
26812704msgstr ""
2705+ ":mod:`!datetime` 模块有一个基本 :class:`timezone` 类(用来处理任意与 UTC 的固定时差)及其 "
2706+ ":attr:`timezone.utc` 属性(UTC 时区实例)。"
26822707
26832708#: ../../library/datetime.rst:2233
26842709msgid ""
@@ -2784,7 +2809,7 @@ msgstr "UTC 时区,``timezone(timedelta(0))``。"
27842809
27852810#: ../../library/datetime.rst:2323
27862811msgid ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Behavior"
2787- msgstr ""
2812+ msgstr ":meth:`~.datetime.strftime` 和 :meth:`~.datetime.strptime` 的行为 "
27882813
27892814#: ../../library/datetime.rst:2325
27902815msgid ""
@@ -2809,6 +2834,7 @@ msgid ""
28092834"The table below provides a high-level comparison of "
28102835":meth:`~.datetime.strftime` versus :meth:`~.datetime.strptime`:"
28112836msgstr ""
2837+ "下表提供了 :meth:`~.datetime.strftime` 与 :meth:`~.datetime.strptime` 的高层级比较:"
28122838
28132839#: ../../library/datetime.rst:2337
28142840msgid "``strftime``"
@@ -2870,7 +2896,7 @@ msgstr "``strptime(date_string, format)``"
28702896#: ../../library/datetime.rst:2352
28712897msgid ""
28722898":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Format Codes"
2873- msgstr ""
2899+ msgstr ":meth:`~.datetime.strftime` 和 :meth:`~.datetime.strptime` 格式码 "
28742900
28752901#: ../../library/datetime.rst:2354
28762902msgid ""
0 commit comments