Merge pull request #1987 from pbiering/fix-1984

fix issue#1984  (refix issue#1851)
This commit is contained in:
Peter Bieringer
2026-02-17 09:04:31 +01:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -6,6 +6,7 @@
* Improve: add workaround to remove empty lines in item to avoid reject by vobject parser
* Improve: check/enforce RECURRENCE-ID MUST have the same value type as DTSTART in the recurring component (RFC 5545 3.8.4.4)
* Fix: RECURRENCE-ID comparison on all-day events
* Fix: format_ut problem on 32-bit systems (got lost inbetween since fixed in 3.5.8)
## 3.6.0

View File

@@ -338,10 +338,13 @@ def format_ut(unixtime: int) -> str:
elif unixtime >= DATETIME_MAX_UNIXTIME:
r = str(unixtime) + "(>=MAX:" + str(DATETIME_MAX_UNIXTIME) + ")"
else:
if sys.version_info < (3, 11):
dt = datetime.datetime.utcfromtimestamp(unixtime)
if sys.maxsize > 2**32:
if sys.version_info < (3, 11):
dt = datetime.datetime.utcfromtimestamp(unixtime)
else:
dt = datetime.datetime.fromtimestamp(unixtime, datetime.UTC)
else:
dt = datetime.datetime.fromtimestamp(unixtime, datetime.UTC)
dt = datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc) + datetime.timedelta(seconds=unixtime)
r = str(unixtime) + "(" + dt.strftime('%Y-%m-%dT%H:%M:%SZ') + ")"
return r