Skip to content

Commit 98c1bf9

Browse files
authored
Merge pull request #3206 from adafruit/http-time-api
Replace worldtimeapi with time.now
2 parents ea0c3b3 + 19159cf commit 98c1bf9

File tree

16 files changed

+21
-21
lines changed

16 files changed

+21
-21
lines changed

CircuitPython_WeatherCloud/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88

99
CIRCUITPY_WIFI_SSID="your-wifi-ssid"
1010
CIRCUITPY_WIFI_PASSWORD="your-wifi-password"
11-
timezone="America/New_York" # http://worldtimeapi.org/timezones
11+
timezone="America/New_York" # https://time.now/developer/timezones
1212
openweather_token="putYourOpenWeatherTokenHere"

CircuitStonks/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
CIRCUITPY_WIFI_SSID="your-wifi-ssid"
99
CIRCUITPY_WIFI_PASSWORD="your-wifi-password"
10-
timezone="America/New_York" # http://worldtimeapi.org/timezones
10+
timezone="America/New_York" # https://time.now/developer/timezones
1111
alphavantage_key="GRABAFREEKEYONLINE"

ESP32_S2_Reverse_TFT_Digital_Clock/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
requests = adafruit_requests.Session(pool, ssl.create_default_context())
2828

2929
# Set up the URL for fetching time data
30-
DATA_SOURCE = "http://worldtimeapi.org/api/timezone/" + os.getenv("TIMEZONE")
30+
DATA_SOURCE = "https://time.now/developer/api/timezone/" + os.getenv("TIMEZONE")
3131

3232
# Set up display a default image
3333
display = board.DISPLAY

IoT_Environment_Sensor/aio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def refresh_local_time(self):
149149
week_day = int(times[3])
150150
is_dst = None # no way to know yet
151151
except KeyError as exc:
152-
raise KeyError("Was unable to lookup the time, try setting timezone in your settings.toml according to http://worldtimeapi.org/timezones") from exc # pylint: disable=line-too-long
152+
raise KeyError("Was unable to lookup the time, try setting timezone in your settings.toml according to https://time.now/developer/timezones") from exc # pylint: disable=line-too-long
153153
year, month, mday = [int(x) for x in the_date.split('-')]
154154
the_time = the_time.split('.')[0]
155155
hours, minutes, seconds = [int(x) for x in the_time.split(':')]

IoT_Environment_Sensor/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ CIRCUITPY_WIFI_SSID="your-wifi-ssid"
99
CIRCUITPY_WIFI_PASSWORD="your-wifi-password"
1010
ADAFRUIT_AIO_USERNAME="my_username"
1111
ADAFRUIT_AIO_KEY="my_key"
12-
timezone="America/New_York" # http://worldtimeapi.org/timezones
12+
timezone="America/New_York" # https://time.now/developer/timezones

IoT_Party_Parrot/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
CIRCUITPY_WIFI_SSID="your-wifi-ssid"
99
CIRCUITPY_WIFI_PASSWORD="your-wifi-password"
10-
timezone="America/New_York" # http://worldtimeapi.org/timezones
10+
timezone="America/New_York" # https://time.now/developer/timezones
1111
twitter_api_key="insert your twitter api key here"
1212
twitter_secret_key="insert your twitter secret key here"
1313
bearer_token="insert your bearer token here"

MagTag/MagTag_CountdownCelebration/code.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
) # we dont know day of week/year or DST
2828

2929
# Set up where we'll be fetching data from
30-
# Check http://worldtimeapi.org/timezones for valid values
30+
# Check https://time.now/developer/timezones for valid values
3131
# pylint: disable=line-too-long
32-
DATA_SOURCE = "http://worldtimeapi.org/api/timezone/America/New_York"
33-
#DATA_SOURCE = "http://worldtimeapi.org/api/timezone/Europe/Stockholm"
32+
DATA_SOURCE = "https://time.now/developer/api/timezone/America/New_York"
33+
#DATA_SOURCE = "https://time.now/developer/api/timezone/Europe/Stockholm"
3434

3535
magtag = MagTag()
3636
magtag.network.connect()

MagTag/MagTag_NextBus/code.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
# 6 hour default.
6868
CLOCK_SYNC_INTERVAL = 6 * 60 * 60
6969
# Load time zone string from settings.toml, else IP geolocation is used
70-
# (http://worldtimeapi.org/api/timezone for list). Again, this is only
70+
# (https://time.now/developer/api/timezone for list). Again, this is only
7171
# used for the 'Last checked' display, not predictions, so it's not
7272
# especially disruptive if missing.
7373
# pylint: disable=bare-except
@@ -117,17 +117,17 @@ def parse_time(timestring, is_dst=-1):
117117
def update_time(timezone=None):
118118
""" Update system date/time from WorldTimeAPI public server;
119119
no account required. Pass in time zone string
120-
(http://worldtimeapi.org/api/timezone for list)
120+
(https://time.now/developer/api/timezone for list)
121121
or None to use IP geolocation. Returns current local time as a
122122
time.struct_time and UTC offset as string. This may throw an
123123
exception on fetch_data() - it is NOT CAUGHT HERE, should be
124124
handled in the calling code because different behaviors may be
125125
needed in different situations (e.g. reschedule for later).
126126
"""
127127
if timezone: # Use timezone api
128-
time_url = 'http://worldtimeapi.org/api/timezone/' + timezone
128+
time_url = 'https://time.now/developer/api/timezone/' + timezone
129129
else: # Use IP geolocation
130-
time_url = 'http://worldtimeapi.org/api/ip'
130+
time_url = 'https://time.now/developer/api/ip'
131131

132132
time_data = NETWORK.fetch_data(time_url,
133133
json_path=[['datetime'], ['dst'],

MagTag/MagTag_Project_Selector/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ CIRCUITPY_WIFI_SSID="your-wifi-ssid"
99
CIRCUITPY_WIFI_PASSWORD="your-wifi-password"
1010
ADAFRUIT_AIO_USERNAME="my_username"
1111
ADAFRUIT_AIO_KEY="my_key"
12-
timezone="America/New_York" # http://worldtimeapi.org/timezones
12+
timezone="America/New_York" # https://time.now/developer/timezones
1313
openweather_token="my_openweather_token"
1414
openweather_location="New York City, US"

Matrix_Portal/Matrix_Portal_Moon_Clock/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
def update_system_time():
7171
""" Update system clock date/time from Adafruit IO. Credentials and time
72-
zone are in settings.toml. See http://worldtimeapi.org/api/timezone for
72+
zone are in settings.toml. See https://time.now/developer/api/timezone for
7373
list of time zones. If missing, will attempt using IP geolocation.
7474
Returns present local (not UTC) time as a struct_time and UTC offset
7575
as string "sHH:MM". This may throw an exception on get_local_time(),

0 commit comments

Comments
 (0)