@@ -48,7 +48,7 @@ Aware and Naive Objects
48
48
-----------------------
49
49
50
50
Date and time objects may be categorized as "aware" or "naive" depending on
51
- whether or not they include timezone information.
51
+ whether or not they include time zone information.
52
52
53
53
With sufficient knowledge of applicable algorithmic and political time
54
54
adjustments, such as time zone and daylight saving time information,
@@ -58,7 +58,7 @@ interpretation. [#]_
58
58
59
59
A **naive ** object does not contain enough information to unambiguously locate
60
60
itself relative to other date/time objects. Whether a naive object represents
61
- Coordinated Universal Time (UTC), local time, or time in some other timezone is
61
+ Coordinated Universal Time (UTC), local time, or time in some other time zone is
62
62
purely up to the program, just like it is up to the program whether a
63
63
particular number represents metres, miles, or mass. Naive objects are easy to
64
64
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
70
70
time, the time zone name, and whether daylight saving time is in effect.
71
71
72
72
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 simple timezones with fixed offsets from UTC, such as UTC itself or
75
- North American EST and EDT timezones . Supporting timezones at deeper levels of
73
+ supplied by the :mod: `!datetime ` module. The :class: `! timezone ` class can
74
+ represent simple time zones with fixed offsets from UTC, such as UTC itself or
75
+ North American EST and EDT time zones . Supporting time zones at deeper levels of
76
76
detail is up to the application. The rules for time adjustment across the
77
77
world are more political than rational, change frequently, and there is no
78
78
standard suitable for every application aside from UTC.
@@ -95,7 +95,7 @@ The :mod:`!datetime` module exports the following constants:
95
95
96
96
.. attribute :: UTC
97
97
98
- Alias for the UTC timezone singleton :attr: `datetime.timezone.utc `.
98
+ Alias for the UTC time zone singleton :attr: `datetime.timezone.utc `.
99
99
100
100
.. versionadded :: 3.11
101
101
@@ -850,7 +850,7 @@ Other constructors, all class methods:
850
850
851
851
.. classmethod :: datetime.today()
852
852
853
- Return the current local datetime , with :attr: `.tzinfo ` ``None ``.
853
+ Return the current local date and time , with :attr: `.tzinfo ` ``None ``.
854
854
855
855
Equivalent to::
856
856
@@ -1051,7 +1051,7 @@ Other constructors, all class methods:
1051
1051
Return a :class: `.datetime ` corresponding to *date_string *, parsed according to
1052
1052
*format *.
1053
1053
1054
- If *format * does not contain microseconds or timezone information, this is equivalent to::
1054
+ If *format * does not contain microseconds or time zone information, this is equivalent to::
1055
1055
1056
1056
datetime(*(time.strptime(date_string, format)[0:6]))
1057
1057
@@ -1267,22 +1267,22 @@ Instance methods:
1267
1267
1268
1268
If provided, *tz * must be an instance of a :class: `tzinfo ` subclass, and its
1269
1269
:meth: `utcoffset ` and :meth: `dst ` methods must not return ``None ``. If *self *
1270
- is naive, it is presumed to represent time in the system timezone .
1270
+ is naive, it is presumed to represent time in the system time zone .
1271
1271
1272
1272
If called without arguments (or with ``tz=None ``) the system local
1273
- timezone is assumed for the target timezone . The ``.tzinfo `` attribute of the converted
1273
+ time zone is assumed for the target time zone . The ``.tzinfo `` attribute of the converted
1274
1274
datetime instance will be set to an instance of :class: `timezone `
1275
1275
with the zone name and offset obtained from the OS.
1276
1276
1277
1277
If ``self.tzinfo `` is *tz *, ``self.astimezone(tz) `` is equal to *self *: no
1278
1278
adjustment of date or time data is performed. Else the result is local
1279
- time in the timezone *tz *, representing the same UTC time as *self *: after
1279
+ time in the time zone *tz *, representing the same UTC time as *self *: after
1280
1280
``astz = dt.astimezone(tz) ``, ``astz - astz.utcoffset() `` will have
1281
1281
the same date and time data as ``dt - dt.utcoffset() ``.
1282
1282
1283
- If you merely want to attach a time zone object *tz * to a datetime *dt * without
1283
+ If you merely want to attach a :class: ` timezone ` object *tz * to a datetime *dt * without
1284
1284
adjustment of date and time data, use ``dt.replace(tzinfo=tz) ``. If you
1285
- merely want to remove the time zone object from an aware datetime *dt * without
1285
+ merely want to remove the :class: ` !timezone ` object from an aware datetime *dt * without
1286
1286
conversion of date and time data, use ``dt.replace(tzinfo=None) ``.
1287
1287
1288
1288
Note that the default :meth: `tzinfo.fromutc ` method can be overridden in a
@@ -1292,7 +1292,7 @@ Instance methods:
1292
1292
def astimezone(self, tz):
1293
1293
if self.tzinfo is tz:
1294
1294
return self
1295
- # Convert self to UTC, and attach the new time zone object.
1295
+ # Convert self to UTC, and attach the new timezone object.
1296
1296
utc = (self - self.utcoffset()).replace(tzinfo=tz)
1297
1297
# Convert from UTC to tz's local time.
1298
1298
return tz.fromutc(utc)
@@ -1406,7 +1406,7 @@ Instance methods:
1406
1406
1407
1407
There is no method to obtain the POSIX timestamp directly from a
1408
1408
naive :class: `.datetime ` instance representing UTC time. If your
1409
- application uses this convention and your system timezone is not
1409
+ application uses this convention and your system time zone is not
1410
1410
set to UTC, you can obtain the POSIX timestamp by supplying
1411
1411
``tzinfo=timezone.utc ``::
1412
1412
@@ -1974,7 +1974,7 @@ Examples of working with a :class:`.time` object::
1974
1974
supply implementations of the standard :class: `tzinfo ` methods needed by the
1975
1975
:class: `.datetime ` methods you use. The :mod: `!datetime ` module provides
1976
1976
:class: `timezone `, a simple concrete subclass of :class: `tzinfo ` which can
1977
- represent timezones with fixed offset from UTC such as UTC itself or North
1977
+ represent time zones with fixed offset from UTC such as UTC itself or North
1978
1978
American EST and EDT.
1979
1979
1980
1980
Special requirement for pickling: A :class: `tzinfo ` subclass must have an
@@ -2099,7 +2099,7 @@ When a :class:`.datetime` object is passed in response to a :class:`.datetime`
2099
2099
method, ``dt.tzinfo `` is the same object as *self *. :class: `tzinfo ` methods can
2100
2100
rely on this, unless user code calls :class: `tzinfo ` methods directly. The
2101
2101
intent is that the :class: `tzinfo ` methods interpret *dt * as being in local
2102
- time, and not need worry about objects in other timezones .
2102
+ time, and not need worry about objects in other time zones .
2103
2103
2104
2104
There is one more :class: `tzinfo ` method that a subclass may wish to override:
2105
2105
@@ -2216,12 +2216,12 @@ only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)).
2216
2216
:mod: `zoneinfo `
2217
2217
The :mod: `!datetime ` module has a basic :class: `timezone ` class (for
2218
2218
handling arbitrary fixed offsets from UTC) and its :attr: `timezone.utc `
2219
- attribute (a UTC timezone instance).
2219
+ attribute (a UTC :class: ` ! timezone` instance).
2220
2220
2221
- ``zoneinfo `` brings the *IANA timezone database * (also known as the Olson
2221
+ ``zoneinfo `` brings the *IANA time zone database * (also known as the Olson
2222
2222
database) to Python, and its usage is recommended.
2223
2223
2224
- `IANA timezone database <https://www.iana.org/time-zones >`_
2224
+ `IANA time zone database <https://www.iana.org/time-zones >`_
2225
2225
The Time Zone Database (often called tz, tzdata or zoneinfo) contains code
2226
2226
and data that represent the history of local time for many representative
2227
2227
locations around the globe. It is updated periodically to reflect changes
@@ -2235,10 +2235,10 @@ only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)).
2235
2235
-------------------------
2236
2236
2237
2237
The :class: `timezone ` class is a subclass of :class: `tzinfo `, each
2238
- instance of which represents a timezone defined by a fixed offset from
2238
+ instance of which represents a time zone defined by a fixed offset from
2239
2239
UTC.
2240
2240
2241
- Objects of this class cannot be used to represent timezone information in the
2241
+ Objects of this class cannot be used to represent time zone information in the
2242
2242
locations where different offsets are used in different days of the year or
2243
2243
where historical changes have been made to civil time.
2244
2244
@@ -2299,7 +2299,7 @@ Class attributes:
2299
2299
2300
2300
.. attribute :: timezone.utc
2301
2301
2302
- The UTC timezone , ``timezone(timedelta(0)) ``.
2302
+ The UTC time zone , ``timezone(timedelta(0)) ``.
2303
2303
2304
2304
2305
2305
.. index ::
@@ -2508,7 +2508,7 @@ Using ``datetime.strptime(date_string, format)`` is equivalent to::
2508
2508
2509
2509
datetime(*(time.strptime(date_string, format)[0:6]))
2510
2510
2511
- except when the format includes sub-second components or timezone offset
2511
+ except when the format includes sub-second components or time zone offset
2512
2512
information, which are supported in ``datetime.strptime `` but are discarded by
2513
2513
``time.strptime ``.
2514
2514
0 commit comments