mirror of
https://github.com/tiennm99/mtprotoproxy.git
synced 2026-10-11 03:13:42 +00:00
use utc timezone when getting the server time
This commit is contained in:
1 parent
1f7ce9e977
commit
949ee12ed2
1 file changed
+1
@@ -2011,6 +2011,7 @@ async def get_srv_time():
|
||||
continue
|
||||
line = line[len("Date: "):].decode()
|
||||
srv_time = datetime.datetime.strptime(line, "%a, %d %b %Y %H:%M:%S %Z")
|
||||
srv_time = srv_time.replace(tzinfo=datetime.timezone.utc)
|
||||
now_time = datetime.datetime.now(datetime.timezone.utc)
|
||||
is_time_skewed = (now_time-srv_time).total_seconds() > MAX_TIME_SKEW
|
||||
if is_time_skewed and config.USE_MIDDLE_PROXY and not disable_middle_proxy:
|
||||
|
||||
Reference in new issue
Block a user