Skip to content

Commit 3578aec

Browse files
sync with cpython 4646ddc3
1 parent 631e084 commit 3578aec

File tree

1 file changed

+64
-50
lines changed

1 file changed

+64
-50
lines changed

library/datetime.po

Lines changed: 64 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: Python 3.14\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"POT-Creation-Date: 2025-12-01 00:17+0000\n"
9+
"POT-Creation-Date: 2025-12-22 00:16+0000\n"
1010
"PO-Revision-Date: 2023-08-07 10:20+0800\n"
1111
"Last-Translator: Griiid <[email protected]>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -680,7 +680,7 @@ msgid ""
680680
msgstr ""
681681

682682
#: ../../library/datetime.rst:400 ../../library/datetime.rst:672
683-
#: ../../library/datetime.rst:2663
683+
#: ../../library/datetime.rst:2696
684684
msgid "Notes:"
685685
msgstr "註解:"
686686

@@ -1790,7 +1790,7 @@ msgid ""
17901790
"equivalent to::"
17911791
msgstr ""
17921792

1793-
#: ../../library/datetime.rst:1148 ../../library/datetime.rst:2643
1793+
#: ../../library/datetime.rst:1148 ../../library/datetime.rst:2676
17941794
msgid "datetime(*(time.strptime(date_string, format)[0:6]))"
17951795
msgstr "datetime(*(time.strptime(date_string, format)[0:6]))"
17961796

@@ -2126,7 +2126,7 @@ msgstr ""
21262126

21272127
#: ../../library/datetime.rst:1431 ../../library/datetime.rst:2042
21282128
#: ../../library/datetime.rst:2149 ../../library/datetime.rst:2394
2129-
#: ../../library/datetime.rst:2406 ../../library/datetime.rst:2716
2129+
#: ../../library/datetime.rst:2406 ../../library/datetime.rst:2749
21302130
msgid "The UTC offset is not restricted to a whole number of minutes."
21312131
msgstr ""
21322132

@@ -3947,7 +3947,7 @@ msgstr "000000, 000001, ..., 999999"
39473947
msgid "\\(5)"
39483948
msgstr "\\(5)"
39493949

3950-
#: ../../library/datetime.rst:2545 ../../library/datetime.rst:2704
3950+
#: ../../library/datetime.rst:2545 ../../library/datetime.rst:2737
39513951
msgid "``%z``"
39523952
msgstr "``%z``"
39533953

@@ -3966,7 +3966,7 @@ msgstr ""
39663966
msgid "\\(6)"
39673967
msgstr "\\(6)"
39683968

3969-
#: ../../library/datetime.rst:2550 ../../library/datetime.rst:2730
3969+
#: ../../library/datetime.rst:2550 ../../library/datetime.rst:2763
39703970
msgid "``%Z``"
39713971
msgstr "``%Z``"
39723972

@@ -4134,7 +4134,7 @@ msgstr "01, 02, ..., 53"
41344134
msgid "\\(8), \\(9)"
41354135
msgstr "\\(8), \\(9)"
41364136

4137-
#: ../../library/datetime.rst:2607 ../../library/datetime.rst:2726
4137+
#: ../../library/datetime.rst:2607 ../../library/datetime.rst:2759
41384138
msgid "``%:z``"
41394139
msgstr "``%:z``"
41404140

@@ -4188,23 +4188,43 @@ msgstr ""
41884188

41894189
#: ../../library/datetime.rst:2637
41904190
msgid ""
4191-
"For the :meth:`.datetime.strptime` class method, the default value is "
4192-
"``1900-01-01T00:00:00.000``: any components not specified in the format "
4193-
"string will be pulled from the default value. [#]_"
4191+
"For the :meth:`.datetime.strptime` and :meth:`.date.strptime` class methods, "
4192+
"the default value is ``1900-01-01T00:00:00.000``: any components not "
4193+
"specified in the format string will be pulled from the default value."
4194+
msgstr ""
4195+
4196+
#: ../../library/datetime.rst:2642
4197+
msgid ""
4198+
"When used to parse partial dates lacking a year, :meth:`.datetime.strptime` "
4199+
"and :meth:`.date.strptime` will raise when encountering February 29 because "
4200+
"the default year of 1900 is *not* a leap year. Always add a default leap "
4201+
"year to partial date strings before parsing."
41944202
msgstr ""
41954203

4196-
#: ../../library/datetime.rst:2641
4204+
#: ../../library/datetime.rst:2663
4205+
msgid ""
4206+
">>> from datetime import datetime\n"
4207+
">>> value = \"2/29\"\n"
4208+
">>> datetime.strptime(value, \"%m/%d\")\n"
4209+
"Traceback (most recent call last):\n"
4210+
"...\n"
4211+
"ValueError: day 29 must be in range 1..28 for month 2 in year 1900\n"
4212+
">>> datetime.strptime(f\"1904 {value}\", \"%Y %m/%d\")\n"
4213+
"datetime.datetime(1904, 2, 29, 0, 0)"
4214+
msgstr ""
4215+
4216+
#: ../../library/datetime.rst:2674
41974217
msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::"
41984218
msgstr ""
41994219

4200-
#: ../../library/datetime.rst:2645
4220+
#: ../../library/datetime.rst:2678
42014221
msgid ""
42024222
"except when the format includes sub-second components or time zone offset "
42034223
"information, which are supported in ``datetime.strptime`` but are discarded "
42044224
"by ``time.strptime``."
42054225
msgstr ""
42064226

4207-
#: ../../library/datetime.rst:2649
4227+
#: ../../library/datetime.rst:2682
42084228
msgid ""
42094229
"For :class:`.time` objects, the format codes for year, month, and day should "
42104230
"not be used, as :class:`!time` objects have no such values. If they're used "
@@ -4214,7 +4234,7 @@ msgstr ""
42144234
"time` 物件並沒有這些值。如果使用這些格式碼,年份會以 1900 代替、月及日會以 1 "
42154235
"代替。"
42164236

4217-
#: ../../library/datetime.rst:2653
4237+
#: ../../library/datetime.rst:2686
42184238
msgid ""
42194239
"For :class:`date` objects, the format codes for hours, minutes, seconds, and "
42204240
"microseconds should not be used, as :class:`date` objects have no such "
@@ -4223,7 +4243,7 @@ msgstr ""
42234243
"對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:"
42244244
"`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 0 代替。"
42254245

4226-
#: ../../library/datetime.rst:2657
4246+
#: ../../library/datetime.rst:2690
42274247
msgid ""
42284248
"For the same reason, handling of format strings containing Unicode code "
42294249
"points that can't be represented in the charset of the current locale is "
@@ -4232,64 +4252,64 @@ msgid ""
42324252
"`UnicodeError` or return an empty string instead."
42334253
msgstr ""
42344254

4235-
#: ../../library/datetime.rst:2666
4255+
#: ../../library/datetime.rst:2699
42364256
msgid ""
42374257
"Because the format depends on the current locale, care should be taken when "
42384258
"making assumptions about the output value. Field orderings will vary (for "
42394259
"example, \"month/day/year\" versus \"day/month/year\"), and the output may "
42404260
"contain non-ASCII characters."
42414261
msgstr ""
42424262

4243-
#: ../../library/datetime.rst:2672
4263+
#: ../../library/datetime.rst:2705
42444264
msgid ""
42454265
"The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] "
42464266
"range, but years < 1000 must be zero-filled to 4-digit width."
42474267
msgstr ""
42484268

4249-
#: ../../library/datetime.rst:2675
4269+
#: ../../library/datetime.rst:2708
42504270
msgid ""
42514271
"In previous versions, :meth:`~.datetime.strftime` method was restricted to "
42524272
"years >= 1900."
42534273
msgstr ""
42544274

4255-
#: ../../library/datetime.rst:2679
4275+
#: ../../library/datetime.rst:2712
42564276
msgid ""
42574277
"In version 3.2, :meth:`~.datetime.strftime` method was restricted to years "
42584278
">= 1000."
42594279
msgstr ""
42604280

4261-
#: ../../library/datetime.rst:2684
4281+
#: ../../library/datetime.rst:2717
42624282
msgid ""
42634283
"When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive "
42644284
"only affects the output hour field if the ``%I`` directive is used to parse "
42654285
"the hour."
42664286
msgstr ""
42674287

4268-
#: ../../library/datetime.rst:2688
4288+
#: ../../library/datetime.rst:2721
42694289
msgid ""
42704290
"Unlike the :mod:`time` module, the :mod:`!datetime` module does not support "
42714291
"leap seconds."
42724292
msgstr ""
42734293

4274-
#: ../../library/datetime.rst:2692
4294+
#: ../../library/datetime.rst:2725
42754295
msgid ""
42764296
"When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive "
42774297
"accepts from one to six digits and zero pads on the right. ``%f`` is an "
42784298
"extension to the set of format characters in the C standard (but implemented "
42794299
"separately in datetime objects, and therefore always available)."
42804300
msgstr ""
42814301

4282-
#: ../../library/datetime.rst:2699
4302+
#: ../../library/datetime.rst:2732
42834303
msgid ""
42844304
"For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced "
42854305
"by empty strings."
42864306
msgstr ""
42874307

4288-
#: ../../library/datetime.rst:2702
4308+
#: ../../library/datetime.rst:2735
42894309
msgid "For an aware object:"
42904310
msgstr ""
42914311

4292-
#: ../../library/datetime.rst:2705
4312+
#: ../../library/datetime.rst:2738
42934313
msgid ""
42944314
":meth:`~.datetime.utcoffset` is transformed into a string of the form "
42954315
"``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number "
@@ -4303,7 +4323,7 @@ msgid ""
43034323
"replaced with the string ``'-0330'``."
43044324
msgstr ""
43054325

4306-
#: ../../library/datetime.rst:2719
4326+
#: ../../library/datetime.rst:2752
43074327
msgid ""
43084328
"When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` "
43094329
"method, the UTC offsets can have a colon as a separator between hours, "
@@ -4312,78 +4332,78 @@ msgid ""
43124332
"``'+00:00'``."
43134333
msgstr ""
43144334

4315-
#: ../../library/datetime.rst:2727
4335+
#: ../../library/datetime.rst:2760
43164336
msgid ""
43174337
"Behaves exactly as ``%z``, but has a colon separator added between hours, "
43184338
"minutes and seconds."
43194339
msgstr ""
43204340

4321-
#: ../../library/datetime.rst:2731
4341+
#: ../../library/datetime.rst:2764
43224342
msgid ""
43234343
"In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :"
43244344
"meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by "
43254345
"the returned value, which must be a string."
43264346
msgstr ""
43274347

4328-
#: ../../library/datetime.rst:2735
4348+
#: ../../library/datetime.rst:2768
43294349
msgid ":meth:`~.datetime.strptime` only accepts certain values for ``%Z``:"
43304350
msgstr ""
43314351

4332-
#: ../../library/datetime.rst:2737
4352+
#: ../../library/datetime.rst:2770
43334353
msgid "any value in ``time.tzname`` for your machine's locale"
43344354
msgstr ""
43354355

4336-
#: ../../library/datetime.rst:2738
4356+
#: ../../library/datetime.rst:2771
43374357
msgid "the hard-coded values ``UTC`` and ``GMT``"
43384358
msgstr ""
43394359

4340-
#: ../../library/datetime.rst:2740
4360+
#: ../../library/datetime.rst:2773
43414361
msgid ""
43424362
"So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid "
43434363
"values, but probably not ``EST``. It will raise ``ValueError`` for invalid "
43444364
"values."
43454365
msgstr ""
43464366

4347-
#: ../../library/datetime.rst:2744
4367+
#: ../../library/datetime.rst:2777
43484368
msgid ""
43494369
"When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` "
43504370
"method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` "
43514371
"of the result will be set to a :class:`timezone` instance."
43524372
msgstr ""
43534373

4354-
#: ../../library/datetime.rst:2750
4374+
#: ../../library/datetime.rst:2783
43554375
msgid ""
43564376
"When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are "
43574377
"only used in calculations when the day of the week and the calendar year "
43584378
"(``%Y``) are specified."
43594379
msgstr ""
43604380

4361-
#: ../../library/datetime.rst:2755
4381+
#: ../../library/datetime.rst:2788
43624382
msgid ""
43634383
"Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the "
43644384
"day of the week and the ISO year (``%G``) are specified in a :meth:`~."
43654385
"datetime.strptime` format string. Also note that ``%G`` and ``%Y`` are not "
43664386
"interchangeable."
43674387
msgstr ""
43684388

4369-
#: ../../library/datetime.rst:2761
4389+
#: ../../library/datetime.rst:2794
43704390
msgid ""
43714391
"When used with the :meth:`~.datetime.strptime` method, the leading zero is "
43724392
"optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, "
43734393
"``%j``, ``%U``, ``%W``, and ``%V``. Format ``%y`` does require a leading "
43744394
"zero."
43754395
msgstr ""
43764396

4377-
#: ../../library/datetime.rst:2766
4397+
#: ../../library/datetime.rst:2799
43784398
msgid ""
43794399
"When parsing a month and day using :meth:`~.datetime.strptime`, always "
43804400
"include a year in the format. If the value you need to parse lacks a year, "
43814401
"append an explicit dummy leap year. Otherwise your code will raise an "
43824402
"exception when it encounters leap day because the default year used by the "
4383-
"parser is not a leap year. Users run into this bug every four years..."
4403+
"parser (1900) is not a leap year. Users run into that bug every leap year."
43844404
msgstr ""
43854405

4386-
#: ../../library/datetime.rst:2772
4406+
#: ../../library/datetime.rst:2805
43874407
msgid ""
43884408
">>> month_day = \"02/29\"\n"
43894409
">>> datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap year "
@@ -4395,23 +4415,23 @@ msgstr ""
43954415
"題。\n"
43964416
"datetime.datetime(1984, 2, 29, 0, 0)"
43974417

4398-
#: ../../library/datetime.rst:2778
4418+
#: ../../library/datetime.rst:2811
43994419
msgid ""
44004420
":meth:`~.datetime.strptime` calls using a format string containing a day of "
44014421
"month without a year now emit a :exc:`DeprecationWarning`. In 3.15 or later "
44024422
"we may change this into an error or change the default year to a leap year. "
44034423
"See :gh:`70647`."
44044424
msgstr ""
44054425

4406-
#: ../../library/datetime.rst:2785
4426+
#: ../../library/datetime.rst:2818
44074427
msgid "Footnotes"
44084428
msgstr "註解"
44094429

4410-
#: ../../library/datetime.rst:2786
4430+
#: ../../library/datetime.rst:2819
44114431
msgid "If, that is, we ignore the effects of Relativity"
44124432
msgstr "也就是說,我們會忽略相對論的效應"
44134433

4414-
#: ../../library/datetime.rst:2788
4434+
#: ../../library/datetime.rst:2821
44154435
msgid ""
44164436
"This matches the definition of the \"proleptic Gregorian\" calendar in "
44174437
"Dershowitz and Reingold's book *Calendrical Calculations*, where it's the "
@@ -4420,19 +4440,13 @@ msgid ""
44204440
"systems."
44214441
msgstr ""
44224442

4423-
#: ../../library/datetime.rst:2794
4443+
#: ../../library/datetime.rst:2827
44244444
msgid ""
44254445
"See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar "
44264446
"<https://web.archive.org/web/20220531051136/https://webspace.science.uu.nl/"
44274447
"~gent0113/calendar/isocalendar.htm>`_ for a good explanation."
44284448
msgstr ""
44294449

4430-
#: ../../library/datetime.rst:2798
4431-
msgid ""
4432-
"Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since 1900 is not "
4433-
"a leap year."
4434-
msgstr ""
4435-
44364450
#: ../../library/datetime.rst:2441
44374451
msgid "% (percent)"
44384452
msgstr "% (百分號)"

0 commit comments

Comments
 (0)