1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-07-08 06:45:11 -05:00

[youtube] Enforce UTC (#2402)

and [utils] use `utcnow` in `datetime_from_str`

Related: #2223 
Authored by: coletdjnz
This commit is contained in:
coletdjnz
2022-01-20 15:02:01 +00:00
committed by GitHub
parent 301d07fc4b
commit 396a76f7bf
2 changed files with 7 additions and 5 deletions

View File

@ -1846,7 +1846,7 @@ def datetime_from_str(date_str, precision='auto', format='%Y%m%d'):
if precision == 'auto':
auto_precision = True
precision = 'microsecond'
today = datetime_round(datetime.datetime.now(), precision)
today = datetime_round(datetime.datetime.utcnow(), precision)
if date_str in ('now', 'today'):
return today
if date_str == 'yesterday':