We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
_normalize_expires_on
1 parent 02edd22 commit 2e0a42fCopy full SHA for 2e0a42f
src/azure-cli-core/azure/cli/core/auth/adal_authentication.py
@@ -92,6 +92,13 @@ def _normalize_expires_on(expires_on):
92
expires_on_epoch_int = int(expires_on)
93
except ValueError:
94
import datetime
95
+
96
+ # Python 3.6 doesn't recognize timezone as +00:00.
97
+ # These lines can be dropped after Python 3.6 is dropped.
98
+ # https://stackoverflow.com/questions/30999230/how-to-parse-timezone-with-colon
99
+ if expires_on[-3] == ":":
100
+ expires_on = expires_on[:-3] + expires_on[-2:]
101
102
# Treat as datetime string "11/05/2021 15:18:31 +00:00"
103
expires_on_epoch_int = int(datetime.datetime.strptime(expires_on, '%m/%d/%Y %H:%M:%S %z').timestamp())
104
0 commit comments