@@ -1469,6 +1469,7 @@ msgid ""
1469
1469
"Return a :class:`.datetime` corresponding to *date_string*, parsed according"
1470
1470
" to *format*."
1471
1471
msgstr ""
1472
+ "*date_string* に対応した :class:`.datetime` を返します。 *format* にしたがって構文解析されます。"
1472
1473
1473
1474
#: ../../library/datetime.rst:1034
1474
1475
msgid "This is equivalent to::"
@@ -1481,6 +1482,9 @@ msgid ""
1481
1482
"For a complete list of formatting directives, see :ref:`strftime-strptime-"
1482
1483
"behavior`."
1483
1484
msgstr ""
1485
+ "date_stringとformatが :func:`time.strptime` で構文解析できない場合や、この関数が時刻タプルを返してこない場合には"
1486
+ " :exc:`ValueError` を送出します。完全な書式化ディレクティブのリストについては :ref:`strftime-strptime-"
1487
+ "behavior` を参照してください。"
1484
1488
1485
1489
#: ../../library/datetime.rst:1049
1486
1490
msgid ""
@@ -1575,6 +1579,10 @@ msgid ""
1575
1579
"larger than :const:`MAXYEAR`. Note that no time zone adjustments are done "
1576
1580
"even if the input is an aware object."
1577
1581
msgstr ""
1582
+ "datetime2 は datetime1 から時間 timedelta 移動したもので、 ``timedelta.days`` > 0 の場合未来へ、 ``timedelta.days`` < 0 の場合過去へ移動します。\n"
1583
+ "結果は入力の datetime と同じ :attr:`~.datetime.tzinfo` 属性を持ち、演算後には datetime2 - datetime1 == timedelta となります。\n"
1584
+ "datetime2.year が :const:`MINYEAR` よりも小さいか、 :const:`MAXYEAR` より大きい場合には :exc:`OverflowError` が送出されます。\n"
1585
+ "入力が aware なオブジェクトの場合でもタイムゾーン修正は全く行われません。"
1578
1586
1579
1587
#: ../../library/datetime.rst:1143
1580
1588
msgid ""
@@ -1594,6 +1602,8 @@ msgid ""
1594
1602
"only if both operands are naive, or if both are aware. If one is aware and "
1595
1603
"the other is naive, :exc:`TypeError` is raised."
1596
1604
msgstr ""
1605
+ ":class:`.datetime` から :class:`.datetime` の減算は両方の被演算子が naive であるか、両方とも aware "
1606
+ "である場合にのみ定義されています。片方が aware でもう一方が naive の場合、 :exc:`TypeError` が送出されます。"
1597
1607
1598
1608
#: ../../library/datetime.rst:1152
1599
1609
msgid ""
@@ -1603,6 +1613,8 @@ msgid ""
1603
1613
"such that ``datetime2 + t == datetime1``. No time zone adjustments are done "
1604
1614
"in this case."
1605
1615
msgstr ""
1616
+ "両方とも naive か、両方とも aware で同じ :attr:`~.datetime.tzinfo` 属性を持つ場合、 :attr:`~.datetime.tzinfo` 属性は無視され、結果は ``datetime2 + t == datetime1`` であるような :class:`timedelta` オブジェクト *t* となります。\n"
1617
+ "この場合タイムゾーン修正は全く行われません。"
1606
1618
1607
1619
#: ../../library/datetime.rst:1157
1608
1620
msgid ""
@@ -1612,6 +1624,8 @@ msgid ""
1612
1624
"(b.replace(tzinfo=None) - b.utcoffset())`` except that the implementation "
1613
1625
"never overflows."
1614
1626
msgstr ""
1627
+ "両方が aware で異なる :attr:`~.datetime.tzinfo` 属性を持つ場合、 ``a-b`` は *a* および *b* をまず naive な UTC datetime オブジェクトに変換したかのようにして行います。\n"
1628
+ "演算結果は決してオーバフローを起こさないことを除き、 ``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None) - b.utcoffset())`` と同じになります。"
1615
1629
1616
1630
#: ../../library/datetime.rst:1163
1617
1631
msgid ""
@@ -1627,6 +1641,8 @@ msgid ""
1627
1641
" if an order comparison is attempted. For equality comparisons, naive "
1628
1642
"instances are never equal to aware instances."
1629
1643
msgstr ""
1644
+ "比較の一方が naive であり、もう一方が aware の場合に、順序比較が行われると :exc:`TypeError` "
1645
+ "が送出されます。等価比較では、 naive インスタンスと aware インスタンスは等価になることはありません。"
1630
1646
1631
1647
#: ../../library/datetime.rst:1170
1632
1648
msgid ""
@@ -1637,12 +1653,16 @@ msgid ""
1637
1653
"adjusted by subtracting their UTC offsets (obtained from "
1638
1654
"``self.utcoffset()``)."
1639
1655
msgstr ""
1656
+ "比較対象が両方とも aware で、同じ :attr:`~.datetime.tzinfo` 属性を持つ場合、 :attr:`~.datetime.tzinfo` は無視され datetime だけで比較が行われます。\n"
1657
+ "比較対象が両方とも aware であり、異なる :attr:`~.datetime.tzinfo` 属性を持つ場合、まず最初に (``self.utcoffset()`` で取得できる) それぞれの UTC オフセットを引いて調整します。"
1640
1658
1641
1659
#: ../../library/datetime.rst:1176
1642
1660
msgid ""
1643
1661
"Equality comparisons between aware and naive :class:`.datetime` instances "
1644
1662
"don't raise :exc:`TypeError`."
1645
1663
msgstr ""
1664
+ "aware な :class:`datetime` インスタンスと naive な :class:`datetime` インスタンスの等価比較では "
1665
+ ":exc:`TypeError` は送出されません。"
1646
1666
1647
1667
#: ../../library/datetime.rst:1182
1648
1668
msgid ""
@@ -1656,6 +1676,12 @@ msgid ""
1656
1676
":exc:`TypeError` is raised unless the comparison is ``==`` or ``!=``. The "
1657
1677
"latter cases return :const:`False` or :const:`True`, respectively."
1658
1678
msgstr ""
1679
+ "型混合の比較がデフォルトのオブジェクトアドレス比較となってしまうのを抑止するために、被演算子のもう一方が :class:`.datetime` "
1680
+ "オブジェクトと異なる型のオブジェクトの場合には :exc:`TypeError` が送出されます。しかしながら、被比較演算子のもう一方が "
1681
+ ":meth:`timetuple` 属性を持つ場合には ``NotImplemented`` "
1682
+ "が返されます。このフックにより、他種の日付オブジェクトに型混合比較を実装するチャンスを与えています。そうでない場合, "
1683
+ ":class:`.datetime` オブジェクトと異なる型のオブジェクトが比較されると、比較演算子が ``==`` または ``!=`` でないかぎり"
1684
+ " :exc:`TypeError` が送出されます。後者の場合、それぞれ :const:`False` または :const:`True` を返します。"
1659
1685
1660
1686
#: ../../library/datetime.rst:1196
1661
1687
msgid "Return :class:`date` object with same year, month and day."