1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-10 15:28:33 +00:00

rewording the comment for now

This commit is contained in:
Mozi 2025-01-07 10:46:22 +00:00 committed by GitHub
parent 9cde8563a6
commit 0fcc7521b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1365,12 +1365,9 @@ def datetime_add_months(dt_, months):
def datetime_from_timestamp(timestamp): def datetime_from_timestamp(timestamp):
# Working around out-of-range timestamp values (e.g. negative ones on Windows, # Calling dt.datetime.fromtimestamp with negative timestamps throws error in Windows
# see http://bugs.python.org/issue1646728) # Ref: https://github.com/yt-dlp/yt-dlp/issues/5185, https://github.com/python/cpython/issues/94414,
# Using naive datetime here can break timestamp() in Windows # https://github.com/yt-dlp/yt-dlp/issues/6706#issuecomment-1496842642
# Ref: https://github.com/yt-dlp/yt-dlp/issues/5185, https://github.com/python/cpython/issues/94414
# Also, dt.datetime.fromtimestamp breaks for negative timestamps
# Ref: https://github.com/yt-dlp/yt-dlp/issues/6706#issuecomment-1496842642
return (dt.datetime.fromtimestamp(0, dt.timezone.utc) return (dt.datetime.fromtimestamp(0, dt.timezone.utc)
+ dt.timedelta(seconds=timestamp)) + dt.timedelta(seconds=timestamp))