mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 12:01:28 +00:00
[utils] Fix time_seconds
to use the provided TZ (#6118)
Authored by: Lesmiscore, Grub4K Fixes https://github.com/yt-dlp/yt-dlp/pull/6056
This commit is contained in:
parent
8aa0bd5d10
commit
83c4970e52
|
@ -5585,8 +5585,10 @@ def get_first(obj, keys, **kwargs):
|
|||
|
||||
|
||||
def time_seconds(**kwargs):
|
||||
t = datetime.datetime.now(datetime.timezone(datetime.timedelta(**kwargs)))
|
||||
return t.timestamp()
|
||||
"""
|
||||
Returns TZ-aware time in seconds since the epoch (1970-01-01T00:00:00Z)
|
||||
"""
|
||||
return time.time() + datetime.timedelta(**kwargs).total_seconds()
|
||||
|
||||
|
||||
# create a JSON Web Signature (jws) with HS256 algorithm
|
||||
|
|
Loading…
Reference in a new issue