You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
else: # we'll try to figure it out from the IP address
496
+
print("Getting time from IP address")
497
+
api_url=TIME_SERVICE_IPADDR
500
498
499
+
try:
500
+
response=requests.get(api_url)
501
+
time_json=response.json()
502
+
current_time=time_json['datetime']
503
+
year_day=time_json['day_of_year']
504
+
week_day=time_json['day_of_week']
505
+
is_dst=time_json['dst']
506
+
exceptKeyError:
507
+
raiseKeyError("Was unable to lookup the time, try setting secrets['timezone'] according to http://worldtimeapi.org/timezones") # pylint: disable=line-too-long
0 commit comments