@@ -2293,12 +2293,15 @@ msgid ""
22932293"methods interpret *dt* as being in local time, and not need worry about "
22942294"objects in other timezones."
22952295msgstr ""
2296+ "当传入一个 :class:`.datetime` 对象来回应 :class:`.datetime` 方法时,``dt.tzinfo`` 与 *self*"
2297+ " 是同一对象。 :class:`tzinfo` 方法可以依赖这一点,除非用户代码直接调用了 :class:`tzinfo` 方法。 此行为的目的是使得 "
2298+ ":class:`tzinfo` 方法将 *dt* 解读为本地时间,而不需要担心其他时区的相关对象。"
22962299
22972300#: ../../library/datetime.rst:1817
22982301msgid ""
22992302"There is one more :class:`tzinfo` method that a subclass may wish to "
23002303"override:"
2301- msgstr ""
2304+ msgstr "还有一个额外的 :class:`tzinfo` 方法,某个子类可能会希望重载它: "
23022305
23032306#: ../../library/datetime.rst:1822
23042307msgid ""
@@ -2308,6 +2311,9 @@ msgid ""
23082311"of :meth:`fromutc` is to adjust the date and time data, returning an "
23092312"equivalent datetime in *self*'s local time."
23102313msgstr ""
2314+ "此方法会由默认的 :class:`datetime.astimezone()` 实现来调用。 当被调用时,``dt.tzinfo`` 为 "
2315+ "*self*,并且 *dt* 的日期和时间数据会被视为代表 UTC 时间。 :meth:`fromutc` 的目标是调整日期和时间数据,返回一个等价的 "
2316+ "datetime 来表示 *self* 的本地时间。"
23112317
23122318#: ../../library/datetime.rst:1828
23132319msgid ""
@@ -2323,19 +2329,26 @@ msgid ""
23232329"if the result is one of the hours straddling the moment the standard offset "
23242330"changes."
23252331msgstr ""
2332+ "大多数 :class:`tzinfo` 子类应该能够毫无问题地继承默认的 :meth:`fromutc` 实现。 "
2333+ "它的健壮性足以处理固定差值的时区以及同时负责标准时和夏令时的时区,对于后者甚至还能处理 DST 转换时间在各个年份有变化的情况。 一个默认 "
2334+ ":meth:`fromutc` 实现可能无法在所有情况下正确处理的例子是(与 UTC "
2335+ "的)标准差值取决于所经过的特定日期和时间,这种情况可能由于政治原因而出现。 默认的 :meth:`astimezone` 和 "
2336+ ":meth:`fromutc` 时间可能无法生成你希望的结果,如果这个结果恰好是跨越了标准差值发生改变的时刻当中的某个小时值的话。"
23262337
23272338#: ../../library/datetime.rst:1839
23282339msgid ""
23292340"Skipping code for error cases, the default :meth:`fromutc` implementation "
23302341"acts like::"
2331- msgstr ""
2342+ msgstr "忽略针对错误情况的代码,默认 :meth:`fromutc` 实现的行为方式如下:: "
23322343
23332344#: ../../library/datetime.rst:1857
23342345msgid ""
23352346"In the following :download:`tzinfo_examples.py "
23362347"<../includes/tzinfo_examples.py>` file there are some examples of "
23372348":class:`tzinfo` classes:"
23382349msgstr ""
2350+ "在以下 :download:`tzinfo_examples.py <../includes/tzinfo_examples.py>` 文件中有一些 "
2351+ ":class:`tzinfo` 类的例子:"
23392352
23402353#: ../../library/datetime.rst:1863
23412354msgid ""
0 commit comments