From 5dc1994dc1f182a5b2962b16a4c67eb234d6328d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 28 Sep 2023 18:49:23 +0200 Subject: [PATCH] Updated Datetime --- README.md | 10 +++++----- index.html | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f2cafde..876b448 100644 --- a/README.md +++ b/README.md @@ -614,21 +614,21 @@ from dateutil.tz import tzlocal, gettz ```python = timezone.utc # London without daylight saving time (DST). = timezone() # Timezone with fixed offset from UTC. - = tzlocal() # Local timezone. Also gettz(). + = tzlocal() # Local tz with dynamic offset. Also gettz(). = gettz('/') # 'Continent/City_Name' timezone or None. =
.astimezone([]) # Converts DT to the passed or local fixed zone. = .replace(tzinfo=) # Changes object's timezone without conversion. ``` * **Timezones returned by gettz(), tzlocal(), and implicit local timezone of naive objects have offsets that vary through time due to DST and historical changes of the zone's base offset.** -* **Standard library's zoneinfo.ZoneInfo() can be used instead of gettz() on Python 3.9 and later. It requires 'tzdata' package on Windows.** +* **Standard library's zoneinfo.ZoneInfo() can be used instead of gettz() on Python 3.9 and later. It requires 'tzdata' package on Windows. It doesn't return local tz if arg. is omitted.** ### Encode ```python - = D/T/DT.fromisoformat('') # Object from ISO string. Raises ValueError. + = D/T/DT.fromisoformat() # Object from ISO string. Raises ValueError.
= DT.strptime(, '') # Datetime from str, according to format. = D/DT.fromordinal() # D/DTn from days since the Gregorian NYE 1. - = DT.fromtimestamp() # Local time DTn from seconds since the Epoch. - = DT.fromtimestamp(, ) # Aware datetime from seconds since the Epoch. + = DT.fromtimestamp() # Local time DTn from seconds since the Epoch. + = DT.fromtimestamp(, ) # Aware datetime from seconds since the Epoch. ``` * **ISO strings come in following forms: `'YYYY-MM-DD'`, `'HH:MM:SS.mmmuuu[±HH:MM]'`, or both separated by an arbitrary character. All parts following the hours are optional.** * **Python uses the Unix Epoch: `'1970-01-01 00:00 UTC'`, `'1970-01-01 01:00 CET'`, ...** diff --git a/index.html b/index.html index 6626ef0..6b5740f 100644 --- a/index.html +++ b/index.html @@ -541,7 +541,7 @@ Point(x=1, y=2

Timezone

<tzinfo> = timezone.utc                     # London without daylight saving time (DST).
 <tzinfo> = timezone(<timedelta>)            # Timezone with fixed offset from UTC.
-<tzinfo> = tzlocal()                        # Local timezone. Also gettz().
+<tzinfo> = tzlocal()                        # Local tz with dynamic offset. Also gettz().
 <tzinfo> = gettz('<Continent>/<City>')      # 'Continent/City_Name' timezone or None.
 <DTa>    = <DT>.astimezone([<tzinfo>])      # Converts DT to the passed or local fixed zone.
 <Ta/DTa> = <T/DT>.replace(tzinfo=<tzinfo>)  # Changes object's timezone without conversion.
@@ -549,13 +549,13 @@ Point(x=1, y=2
 
 
  • Timezones returned by gettz(), tzlocal(), and implicit local timezone of naive objects have offsets that vary through time due to DST and historical changes of the zone's base offset.
  • -
  • Standard library's zoneinfo.ZoneInfo() can be used instead of gettz() on Python 3.9 and later. It requires 'tzdata' package on Windows.
  • +
  • Standard library's zoneinfo.ZoneInfo() can be used instead of gettz() on Python 3.9 and later. It requires 'tzdata' package on Windows. It doesn't return local tz if arg. is omitted.
-

Encode

<D/T/DT> = D/T/DT.fromisoformat('<iso>')    # Object from ISO string. Raises ValueError.
+

Encode

<D/T/DT> = D/T/DT.fromisoformat(<str>)      # Object from ISO string. Raises ValueError.
 <DT>     = DT.strptime(<str>, '<format>')   # Datetime from str, according to format.
 <D/DTn>  = D/DT.fromordinal(<int>)          # D/DTn from days since the Gregorian NYE 1.
-<DTn>    = DT.fromtimestamp(<real>)         # Local time DTn from seconds since the Epoch.
-<DTa>    = DT.fromtimestamp(<real>, <tz.>)  # Aware datetime from seconds since the Epoch.
+<DTn>    = DT.fromtimestamp(<float>)        # Local time DTn from seconds since the Epoch.
+<DTa>    = DT.fromtimestamp(<float>, <tz>)  # Aware datetime from seconds since the Epoch.