Skip to content

Commit 9793308

Browse files
committed
Add (hopefully) all UTC offsets
1 parent b6ed30f commit 9793308

File tree

5 files changed

+46
-25
lines changed

5 files changed

+46
-25
lines changed

ats-mini/Common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ typedef struct
114114
{
115115
int8_t offset; // UTC offset in 15 minute intervals
116116
const char *desc; // Short description
117-
const char *city; // City name
118117
} UTCOffset;
119118

120119
typedef struct

ats-mini/Menu.cpp

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -209,31 +209,52 @@ static const char *sleepModeDesc[] =
209209

210210
//
211211
// UTC Offset Menu
212-
// FIXME: add more offsets https://en.wikipedia.org/wiki/List_of_UTC_offsets
212+
// https://en.wikipedia.org/wiki/List_of_UTC_offsets
213+
// https://www.timeanddate.com/time/time-zones-interesting.html
213214
//
214215
uint8_t utcOffsetIdx = 8;
215216
const UTCOffset utcOffsets[] =
216217
{
217-
{ -8 * 4, "UTC-8", "Fairbanks" },
218-
{ -7 * 4, "UTC-7", "San Francisco" },
219-
{ -6 * 4, "UTC-6", "Denver" },
220-
{ -5 * 4, "UTC-5", "Houston" },
221-
{ -4 * 4, "UTC-4", "New York" },
222-
{ -3 * 4, "UTC-3", "Rio de Janeiro" },
223-
{ -2 * 4, "UTC-2", "Sandwich Islands" },
224-
{ -1 * 4, "UTC-1", "Nuuk" },
225-
{ 0 * 4, "UTC+0", "Reykjavik" },
226-
{ 1 * 4, "UTC+1", "London" },
227-
{ 2 * 4, "UTC+2", "Berlin" },
228-
{ 3 * 4, "UTC+3", "Moscow" },
229-
{ 4 * 4, "UTC+4", "Yerevan" },
230-
{ 5 * 4, "UTC+5", "Astana" },
231-
{ 5 * 4 + 2, "UTC+5:30", "Kolkata" },
232-
{ 6 * 4, "UTC+6", "Omsk" },
233-
{ 7 * 4, "UTC+7", "Novosibirsk" },
234-
{ 8 * 4, "UTC+8", "Beijing" },
235-
{ 9 * 4, "UTC+9", "Yakutsk" },
236-
{ 10 * 4, "UTC+10", "Vladivostok" },
218+
{ -12 * 4, "UTC-12" },
219+
{ -11 * 4, "UTC-11" },
220+
{ -10 * 4, "UTC-10" },
221+
{ -9 * 4 - 2, "UTC-9:30" },
222+
{ -9 * 4, "UTC-9" },
223+
{ -8 * 4, "UTC-8" },
224+
{ -7 * 4, "UTC-7" },
225+
{ -6 * 4, "UTC-6" },
226+
{ -5 * 4, "UTC-5" },
227+
{ -4 * 4, "UTC-4" },
228+
{ -3 * 4 - 2, "UTC-3:30" },
229+
{ -3 * 4, "UTC-3" },
230+
{ -2 * 4 - 2, "UTC-2:30" },
231+
{ -2 * 4, "UTC-2" },
232+
{ -1 * 4, "UTC-1" },
233+
{ 0 * 4, "UTC+0" },
234+
{ 1 * 4, "UTC+1" },
235+
{ 2 * 4, "UTC+2" },
236+
{ 3 * 4, "UTC+3" },
237+
{ 3 * 4 + 2, "UTC+3:30" },
238+
{ 4 * 4, "UTC+4" },
239+
{ 4 * 4 + 2, "UTC+4:30" },
240+
{ 5 * 4, "UTC+5" },
241+
{ 5 * 4 + 2, "UTC+5:30" },
242+
{ 5 * 4 + 3, "UTC+5:45" },
243+
{ 6 * 4, "UTC+6" },
244+
{ 6 * 4 + 2, "UTC+6:30" },
245+
{ 7 * 4, "UTC+7" },
246+
{ 8 * 4, "UTC+8" },
247+
{ 8 * 4 + 3, "UTC+8:45" },
248+
{ 9 * 4, "UTC+9" },
249+
{ 9 * 4 + 2, "UTC+9:30" },
250+
{ 10 * 4, "UTC+10" },
251+
{ 10 * 4 + 2, "UTC+10:30" },
252+
{ 11 * 4, "UTC+11" },
253+
{ 12 * 4, "UTC+12" },
254+
{ 12 * 4 + 3, "UTC+12:45" },
255+
{ 13 * 4, "UTC+13" },
256+
{ 13 * 4 + 3, "UTC+13:45" },
257+
{ 14 * 4, "UTC+14" },
237258
};
238259

239260
int getCurrentUTCOffset() { return(utcOffsets[utcOffsetIdx].offset); }

ats-mini/Network.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ static const String webUtcOffsetSelector()
488488
char text[64];
489489

490490
sprintf(text,
491-
"<OPTION VALUE='%d'%s>%s (%s)</OPTION>",
491+
"<OPTION VALUE='%d'%s>%s</OPTION>",
492492
i, utcOffsetIdx==i? " SELECTED":"",
493-
utcOffsets[i].city, utcOffsets[i].desc
493+
utcOffsets[i].desc
494494
);
495495

496496
result += text;

changelog/287.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add an exhaustive (hopefully) list of UTC offsets. WARNING: please adjust your UTC offset again (the stored index is no longer valid).

docs/source/manual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The menu can be invoked by clicking the encoder button and is closed automatical
6969
* **Brightness** - Display brightness level (10...255). The minimal one draws about 80mA of the battery power, the default one about 100mA, the max level about 120mA.
7070
* **Calibration** - SSB calibration offset (-2000...2000, per mode/band).
7171
* **RDS** - Radio Data System options: PS - radio station name, CT - time, RT - text, PTY - genre, ALL (EU/US) - everything. Note that the time can be transmitted either in UTC or in local timezone, as well as be completely bogus. The clock is synchronized only once, so you can pick the right time source (switch the receiver power off and on to resync it again).
72-
* **UTC Offset** - Affects the displayed time, whether it was received via RDS or NTP.
72+
* **UTC Offset** - Affects the displayed time, whether it was received via RDS or NTP. Please note that automatic DST transitions are not supported, the offset needs to be adjusted manually.
7373
* **FM Region** - FM de-emphasis time constant by region (50µs for EU/JP/AU and 70µs for the US).
7474
* **Theme** - Color theme.
7575
* **UI Layout** - Alternative UI layouts. For now there is just one alternative UI with large S-meter and S/N-meter.

0 commit comments

Comments
 (0)