1
0
Fork 0

[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
commit 396a76f7bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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':