Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1755df7

Browse files
authored
gh-85453: Fix 'timezone' vs. 'time zone' spelling issues in datetime.rst (#118449)
1 parent7e91e0d commit1755df7

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

‎Doc/library/datetime.rst‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Aware and Naive Objects
4848
-----------------------
4949

5050
Date and time objects may be categorized as "aware" or "naive" depending on
51-
whether or not they includetimezone information.
51+
whether or not they includetime zone information.
5252

5353
With sufficient knowledge of applicable algorithmic and political time
5454
adjustments, such as time zone and daylight saving time information,
@@ -58,7 +58,7 @@ interpretation. [#]_
5858

5959
A **naive** object does not contain enough information to unambiguously locate
6060
itself relative to other date/time objects. Whether a naive object represents
61-
Coordinated Universal Time (UTC), local time, or time in some othertimezone is
61+
Coordinated Universal Time (UTC), local time, or time in some othertime zone is
6262
purely up to the program, just like it is up to the program whether a
6363
particular number represents metres, miles, or mass. Naive objects are easy to
6464
understand and to work with, at the cost of ignoring some aspects of reality.
@@ -70,9 +70,9 @@ These :class:`tzinfo` objects capture information about the offset from UTC
7070
time, the time zone name, and whether daylight saving time is in effect.
7171

7272
Only one concrete:class:`tzinfo` class, the:class:`timezone` class, is
73-
supplied by the:mod:`!datetime` module. The:class:`timezone` class can
74-
represent simpletimezones with fixed offsets from UTC, such as UTC itself or
75-
North American EST and EDTtimezones. Supportingtimezones at deeper levels of
73+
supplied by the:mod:`!datetime` module. The:class:`!timezone` class can
74+
represent simpletime zones with fixed offsets from UTC, such as UTC itself or
75+
North American EST and EDTtime zones. Supportingtime zones at deeper levels of
7676
detail is up to the application. The rules for time adjustment across the
7777
world are more political than rational, change frequently, and there is no
7878
standard suitable for every application aside from UTC.
@@ -95,7 +95,7 @@ The :mod:`!datetime` module exports the following constants:
9595

9696
..attribute::UTC
9797

98-
Alias for the UTCtimezone singleton:attr:`datetime.timezone.utc`.
98+
Alias for the UTCtime zone singleton:attr:`datetime.timezone.utc`.
9999

100100
..versionadded::3.11
101101

@@ -869,7 +869,7 @@ Other constructors, all class methods:
869869

870870
..classmethod::datetime.today()
871871

872-
Return the current localdatetime, with:attr:`.tzinfo` ``None``.
872+
Return the current localdate and time, with:attr:`.tzinfo` ``None``.
873873

874874
Equivalent to::
875875

@@ -1070,7 +1070,7 @@ Other constructors, all class methods:
10701070
Return a:class:`.datetime` corresponding to *date_string*, parsed according to
10711071
*format*.
10721072

1073-
If *format* does not contain microseconds ortimezone information, this is equivalent to::
1073+
If *format* does not contain microseconds ortime zone information, this is equivalent to::
10741074

10751075
datetime(*(time.strptime(date_string, format)[0:6]))
10761076

@@ -1311,22 +1311,22 @@ Instance methods:
13111311

13121312
If provided, *tz* must be an instance of a:class:`tzinfo` subclass, and its
13131313
:meth:`utcoffset` and:meth:`dst` methods must not return ``None``. If *self*
1314-
is naive, it is presumed to represent time in the systemtimezone.
1314+
is naive, it is presumed to represent time in the systemtime zone.
13151315

13161316
If called without arguments (or with ``tz=None``) the system local
1317-
timezoneis assumed for the targettimezone. The ``.tzinfo`` attribute of the converted
1317+
time zoneis assumed for the targettime zone. The ``.tzinfo`` attribute of the converted
13181318
datetime instance will be set to an instance of:class:`timezone`
13191319
with the zone name and offset obtained from the OS.
13201320

13211321
If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no
13221322
adjustment of date or time data is performed. Else the result is local
1323-
time in thetimezone *tz*, representing the same UTC time as *self*: after
1323+
time in thetime zone *tz*, representing the same UTC time as *self*: after
13241324
``astz = dt.astimezone(tz)``, ``astz - astz.utcoffset()`` will have
13251325
the same date and time data as ``dt - dt.utcoffset()``.
13261326

1327-
If you merely want to attach atime zone object *tz* to a datetime *dt* without
1327+
If you merely want to attach a:class:`timezone` object *tz* to a datetime *dt* without
13281328
adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If you
1329-
merely want to remove thetime zone object from an aware datetime *dt* without
1329+
merely want to remove the:class:`!timezone` object from an aware datetime *dt* without
13301330
conversion of date and time data, use ``dt.replace(tzinfo=None)``.
13311331

13321332
Note that the default:meth:`tzinfo.fromutc` method can be overridden in a
@@ -1336,7 +1336,7 @@ Instance methods:
13361336
def astimezone(self, tz):
13371337
if self.tzinfo is tz:
13381338
return self
1339-
# Convert self to UTC, and attach the newtime zone object.
1339+
# Convert self to UTC, and attach the newtimezone object.
13401340
utc = (self - self.utcoffset()).replace(tzinfo=tz)
13411341
# Convert from UTC to tz's local time.
13421342
return tz.fromutc(utc)
@@ -1450,7 +1450,7 @@ Instance methods:
14501450

14511451
There is no method to obtain the POSIX timestamp directly from a
14521452
naive:class:`.datetime` instance representing UTC time. If your
1453-
application uses this convention and your systemtimezone is not
1453+
application uses this convention and your systemtime zone is not
14541454
set to UTC, you can obtain the POSIX timestamp by supplying
14551455
``tzinfo=timezone.utc``::
14561456

@@ -2021,7 +2021,7 @@ Examples of working with a :class:`.time` object::
20212021
supply implementations of the standard:class:`tzinfo` methods needed by the
20222022
:class:`.datetime` methods you use. The:mod:`!datetime` module provides
20232023
:class:`timezone`, a simple concrete subclass of:class:`tzinfo` which can
2024-
representtimezones with fixed offset from UTC such as UTC itself or North
2024+
representtime zones with fixed offset from UTC such as UTC itself or North
20252025
American EST and EDT.
20262026

20272027
Special requirement for pickling: A:class:`tzinfo` subclass must have an
@@ -2146,7 +2146,7 @@ When a :class:`.datetime` object is passed in response to a :class:`.datetime`
21462146
method, ``dt.tzinfo`` is the same object as *self*.:class:`tzinfo` methods can
21472147
rely on this, unless user code calls:class:`tzinfo` methods directly. The
21482148
intent is that the:class:`tzinfo` methods interpret *dt* as being in local
2149-
time, and not need worry about objects in othertimezones.
2149+
time, and not need worry about objects in othertime zones.
21502150

21512151
There is one more:class:`tzinfo` method that a subclass may wish to override:
21522152

@@ -2263,12 +2263,12 @@ only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)).
22632263
:mod:`zoneinfo`
22642264
The:mod:`!datetime` module has a basic:class:`timezone` class (for
22652265
handling arbitrary fixed offsets from UTC) and its:attr:`timezone.utc`
2266-
attribute (a UTC timezone instance).
2266+
attribute (a UTC:class:`!timezone` instance).
22672267

2268-
``zoneinfo`` brings the *IANAtimezone database* (also known as the Olson
2268+
``zoneinfo`` brings the *IANAtime zone database* (also known as the Olson
22692269
database) to Python, and its usage is recommended.
22702270

2271-
`IANAtimezone database<https://www.iana.org/time-zones>`_
2271+
`IANAtime zone database<https://www.iana.org/time-zones>`_
22722272
The Time Zone Database (often called tz, tzdata or zoneinfo) contains code
22732273
and data that represent the history of local time for many representative
22742274
locations around the globe. It is updated periodically to reflect changes
@@ -2282,10 +2282,10 @@ only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)).
22822282
-------------------------
22832283

22842284
The:class:`timezone` class is a subclass of:class:`tzinfo`, each
2285-
instance of which represents atimezone defined by a fixed offset from
2285+
instance of which represents atime zone defined by a fixed offset from
22862286
UTC.
22872287

2288-
Objects of this class cannot be used to representtimezone information in the
2288+
Objects of this class cannot be used to representtime zone information in the
22892289
locations where different offsets are used in different days of the year or
22902290
where historical changes have been made to civil time.
22912291

@@ -2346,7 +2346,7 @@ Class attributes:
23462346

23472347
..attribute::timezone.utc
23482348

2349-
The UTCtimezone, ``timezone(timedelta(0))``.
2349+
The UTCtime zone, ``timezone(timedelta(0))``.
23502350

23512351

23522352
..index::
@@ -2555,7 +2555,7 @@ Using ``datetime.strptime(date_string, format)`` is equivalent to::
25552555

25562556
datetime(*(time.strptime(date_string, format)[0:6]))
25572557

2558-
except when the format includes sub-second components ortimezone offset
2558+
except when the format includes sub-second components ortime zone offset
25592559
information, which are supported in ``datetime.strptime`` but are discarded by
25602560
``time.strptime``.
25612561

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp