What's the best way to handle a long list in settings?

Hello,

What's the best way to handle a long list in settings?

I am making a watch face where the user can select a time zone or Zulu offset.  There are over 30 different time zones around the globe and I'd rather not do a super long list.  Mainly because I'd have to create over 30 items in the list, then re-create this in strings.  Any thoughts?

I've considered doing 5 different number entries (1st for plus or minus, 2nd & 3rd for hours, 4th and 5th for minutes), but I have no say in the formatting of the settings page (other than <group>) to make it look obvious.  

I tried asking for the hours separate from the minutes (constrained with min-max), but i don't think it was clear what I was looking for.

I could ask for the time zone as a string and then reference a database, but then I'd have to create and maintain a database of currently 117 time zones (https://www.worlddata.info/timezones/index.php).

Thoughts?

Top Replies

All Replies

  • So...For the UTC offset (walk then run... I'm still a pilot first, programmer second), it sounds like a string.xml and a matching properties.xml of 31 different time zones is the way to go?  There's no way to ...load an array once (I did not see that option in the documentation)?

  • There's no way to ...load an array once

    Not sure what you mean by this, but yes, IMO the only way to do timezones properly (with support for daylight savings time) is to have a huge list (which is more like 100 entries unfortunately). The usability of this list probably won't be great on your phone.

    But then you have to determine the time zone rules for each of the entries. (I gave some examples in a previous comment, although the format would not really be understandable for non-experts.)

    e.g.
    "Eastern Time (UTC-5)" => "EST+5EDT,M3.2.0/2,M11.1.0/2"

    The string on the left side is the user-friendly time zone name, and the right side is the specification for the time zone in a standard format (linux TZ environment variable). I only used that format to illustrate how the time zone rule can be expressed in a fairly compact format.

    - Explanation: "Eastern Time" means:

    • The standard 3 letter time zone abbreviation is "EST"
    • The standard UTC offset is -5
    • The DST abbreviation is "EDT"
    • The transition to DST is on the 3rd month, 2nd week, first day, at 2 am
    • The transition back to standard time is on the 11th month, 1st week, first day, at 2 am

    "Mountain Time (UTC-7)" => "MST+7MDT,M3.2.0/2,M11.1.0/2"

    - Same as Eastern Time, but with -7 offset from UTC. (I just guessed that the month/week/day/time of transition is the same, it's not meant to be accurate)

    "Arizona (UTC-7)" => "MST+7"

    - UTC -7 with no DST

    So to be clear, yes, handling time zones with automatic daylight savings time is somewhat complex. But the existence of exceptions to the rules such as Yukon and Arizona does not make this problem appreciably more complex.

    From my POV, the issues are:

    - finding and converting 100+ time zone rules for your purposes (if you're not a coder first, this isn't trivial).

    - displaying a list of 100 items in the settings. It probably won't have great usability on the Connect IQ app, although it might not be impossible to use.

    - just having 100 strings in your app will take a significant amount of memory if you load any resources at all during runtime

    Another way to do this, as Jim has suggested in the past, is to the let the user select a time zone offset, and give them a checkbox for DST. So it's up to the user to tell you when DST is in effect, and this simplifies things by a lot.

    Or even more simply, just give them the offset setting. So if the user lives in New York, they would have to manually switch between -5 and -4 when appropriate.

  • Don't forget that some of those "rules "change  once or twice a year.

    Garmin sends out a tzmap file usually a couple times a year, but there is no way to access the info in CIQ.

  • Don't forget that some of those "rules "change  once or twice a year.

    Yeah I already said that this method doesn't account for historical changes. Perfect is the enemy of good.

    Here's my pretty old list of 451 (!) TZ rules from circa 2013 (T_T), in CSV format. Obviously this full list is totally unsuitable because:

    - Garmin has tight storage and memory limits

    - Your time zones will be displayed in a simple dropdown list on a phone, with no search or autocomplete. Even 100 items is really pushing it

    You could start by cutting down the list to the zones you care about (maybe the 100 or so that Windows provides when you select a time zone manually). There's a lot of duplicates here such as "Canada/Eastern" and "America/Eastern" as well as rules for very small or remote places.

    Once it's down to a manageable size (a few dozen to maybe no more than 100), you could do the research to see which rules have been updated. You would also save a lot of space by storing only the short name.

    I'm not claiming it's an easy solution or anything, but it's not impossible. It would just take some time.

    (Here's the explanation of the format used in the TZ_STRING column: [https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html])

    ID,TZ_STRING,LONG_NAME,SHORT_NAME
    0,"GMT0","Africa/Abidjan","Africa/Abidjan"
    1,"GMT0","Africa/Accra","Africa/Accra"
    2,"EAT-3","Africa/Addis Ababa","Africa/Addis Ababa"
    3,"CET-1","Africa/Algiers","Africa/Algiers"
    4,"EAT-3","Africa/Asmera","Africa/Asmera"
    5,"GMT0","Africa/Bamako","Africa/Bamako"
    6,"WAT-1","Africa/Bangui","Africa/Bangui"
    7,"GMT0","Africa/Banjul","Africa/Banjul"
    8,"GMT0","Africa/Bissau","Africa/Bissau"
    9,"CAT-2","Africa/Blantyre","Africa/Blantyre"
    10,"WAT-1","Africa/Brazzaville","Africa/Brazzaville"
    11,"CAT-2","Africa/Bujumbura","Africa/Bujumbura"
    12,"EET-2EEST-3,M4.5.5/0,M9.5.4/24","Africa/Cairo","Africa/Cairo"
    13,"WET0","Africa/Casablanca","Africa/Casablanca"
    14,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Africa/Ceuta","Africa/Ceuta"
    15,"GMT0","Africa/Conakry","Africa/Conakry"
    16,"GMT0","Africa/Dakar","Africa/Dakar"
    17,"EAT-3","Africa/Dar es Salaam","Africa/Dar es Salaam"
    18,"EAT-3","Africa/Djibouti","Africa/Djibouti"
    19,"WAT-1","Africa/Douala","Africa/Douala"
    20,"WET0","Africa/El Aaiun","Africa/El Aaiun"
    21,"WAT0","Africa/Freetown","Africa/Freetown"
    22,"CAT-2","Africa/Gaborone","Africa/Gaborone"
    23,"CAT-2","Africa/Harare","Africa/Harare"
    24,"SAST-2","Africa/Johannesburg","Africa/Johannesburg"
    25,"EAT-3","Africa/Kampala","Africa/Kampala"
    26,"EAT-3","Africa/Khartoum","Africa/Khartoum"
    27,"CAT-2","Africa/Kigali","Africa/Kigali"
    28,"WAT-1","Africa/Kinshasa","Africa/Kinshasa"
    29,"WAT-1","Africa/Lagos","Africa/Lagos"
    30,"WAT-1","Africa/Libreville","Africa/Libreville"
    31,"GMT0","Africa/Lome","Africa/Lome"
    32,"WAT-1","Africa/Luanda","Africa/Luanda"
    33,"CAT-2","Africa/Lubumbashi","Africa/Lubumbashi"
    34,"CAT-2","Africa/Lusaka","Africa/Lusaka"
    35,"WAT-1","Africa/Malabo","Africa/Malabo"
    36,"CAT-2","Africa/Maputo","Africa/Maputo"
    37,"SAST-2","Africa/Maseru","Africa/Maseru"
    38,"SAST-2","Africa/Mbabane","Africa/Mbabane"
    39,"EAT-3","Africa/Mogadishu","Africa/Mogadishu"
    40,"GMT0","Africa/Monrovia","Africa/Monrovia"
    41,"EAT-3","Africa/Nairobi","Africa/Nairobi"
    42,"WAT-1","Africa/Ndjamena","Africa/Ndjamena"
    43,"WAT-1","Africa/Niamey","Africa/Niamey"
    44,"GMT0","Africa/Nouakchott","Africa/Nouakchott"
    45,"GMT0","Africa/Ouagadougou","Africa/Ouagadougou"
    46,"WAT-1","Africa/Porto-Novo","Africa/Porto-Novo"
    47,"GMT0","Africa/Sao Tome","Africa/Sao Tome"
    48,"GMT0","Africa/Timbuktu","Africa/Timbuktu"
    49,"EET-2","Africa/Tripoli","Africa/Tripoli"
    50,"CET-1","Africa/Tunis","Africa/Tunis"
    51,"WAT-1WAST-2,M9.1.0/2,M4.1.0/2","Africa/Windhoek","Africa/Windhoek"
    52,"HAST10HADT9,M3.2.0/2,M11.1.0/2","America/Adak","America/Adak"
    53,"AKST9AKDT8,M3.2.0/2,M11.1.0/2","America/Anchorage","America/Anchorage"
    54,"AST4","America/Anguilla","America/Anguilla"
    55,"AST4","America/Antigua","America/Antigua"
    56,"BRT3BRST2,M10.2.0/0,M2.3.0/0","America/Araguaina","America/Araguaina"
    57,"AST4","America/Aruba","America/Aruba"
    58,"PYT4PYST3,M10.1.0/0,M3.1.0/0","America/Asuncion","America/Asuncion"
    59,"HAST10HADT9,M3.2.0/2,M11.1.0/2","America/Atka","America/Atka"
    60,"AST4","America/Barbados","America/Barbados"
    61,"BRT3","America/Belem","America/Belem"
    62,"CST6","America/Belize","America/Belize"
    63,"AMT4","America/Boa Vista","America/Boa Vista"
    64,"COT5","America/Bogota","America/Bogota"
    65,"MST7MDT6,M3.2.0/2,M11.1.0/2","America/Boise","America/Boise"
    66,"ART3","America/Buenos Aires","America/Buenos Aires"
    67,"MST7MDT6,M3.2.0/2,M11.1.0/2","America/Cambridge Bay","America/Cambridge Bay"
    68,"CST6CDT5,M5.1.0/2,M9.5.0/2","America/Cancun","America/Cancun"
    69,"VET4","America/Caracas","America/Caracas"
    70,"ART3","America/Catamarca","America/Catamarca"
    71,"GFT3","America/Cayenne","America/Cayenne"
    72,"EST5","America/Cayman","America/Cayman"
    73,"CST6CDT5,M3.2.0/2,M11.1.0/2","America/Chicago","America/Chicago"
    74,"MST7MDT6,M5.1.0/2,M9.5.0/2","America/Chihuahua","America/Chihuahua"
    75,"ART3","America/Cordoba","America/Cordoba"
    76,"CST6","America/Costa Rica","America/Costa Rica"
    77,"AMT4AMST3,M10.2.0/0,M2.3.0/0","America/Cuiaba","America/Cuiaba"
    78,"AST4","America/Curacao","America/Curacao"
    79,"GMT0","America/Danmarkshavn","America/Danmarkshavn"
    80,"PST8PDT7,M3.2.0/2,M11.1.0/2","America/Dawson","America/Dawson"
    81,"MST7","America/Dawson Creek","America/Dawson Creek"
    82,"MST7MDT6,M3.2.0/2,M11.1.0/2","America/Denver","America/Denver"
    83,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/Detroit","America/Detroit"
    84,"AST4","America/Dominica","America/Dominica"
    85,"MST7MDT6,M3.2.0/2,M11.1.0/2","America/Edmonton","America/Edmonton"
    86,"ACT5","America/Eirunepe","America/Eirunepe"
    87,"CST6","America/El Salvador","America/El Salvador"
    88,"PST8PDT7,M3.2.0/2,M11.1.0/2","America/Ensenada","America/Ensenada"
    89,"EST5","America/Fort Wayne","America/Fort Wayne"
    90,"BRT3BRST2,M10.2.0/0,M2.3.0/0","America/Fortaleza","America/Fortaleza"
    91,"AST4ADT3,M3.2.0/2,M11.1.0/2","America/Glace Bay","America/Glace Bay"
    92,"WGT3WGST2,M3.5.0/-2,M10.5.0/-1","America/Godthab","America/Godthab"
    93,"AST4ADT3,M3.2.0/0:01,M11.1.0/0:01","America/Goose Bay","America/Goose Bay"
    94,"EST5EDT4,M3.2.0/0,M11.1.0/0","America/Grand Turk","America/Grand Turk"
    95,"AST4","America/Grenada","America/Grenada"
    96,"AST4","America/Guadeloupe","America/Guadeloupe"
    97,"CST6","America/Guatemala","America/Guatemala"
    98,"ECT5","America/Guayaquil","America/Guayaquil"
    99,"GYT4","America/Guyana","America/Guyana"
    100,"AST4ADT3,M3.2.0/2,M11.1.0/2","America/Halifax","America/Halifax"
    101,"CST5CDT4,M4.1.0/0,M10.5.0/1","America/Havana","America/Havana"
    102,"MST7","America/Hermosillo","America/Hermosillo"
    103,"EST5","America/Indiana/Indianapolis","America/Indiana/Indianapolis"
    104,"EST5","America/Indiana/Knox","America/Indiana/Knox"
    105,"EST5","America/Indiana/Marengo","America/Indiana/Marengo"
    106,"EST5","America/Indiana/Vevay","America/Indiana/Vevay"
    107,"EST5","America/Indianapolis","America/Indianapolis"
    108,"MST7MDT6,M3.2.0/2,M11.1.0/2","America/Inuvik","America/Inuvik"
    109,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/Iqaluit","America/Iqaluit"
    110,"EST5","America/Jamaica","America/Jamaica"
    111,"ART3","America/Jujuy","America/Jujuy"
    112,"AKST9AKDT8,M3.2.0/2,M11.1.0/2","America/Juneau","America/Juneau"
    113,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/Kentucky/Louisville","America/Kentucky/Louisville"
    114,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/Kentucky/Monticello","America/Kentucky/Monticello"
    115,"EST5","America/Knox IN","America/Knox IN"
    116,"BOT4","America/La Paz","America/La Paz"
    117,"PET5","America/Lima","America/Lima"
    118,"PST8PDT7,M3.2.0/2,M11.1.0/2","America/Los Angeles","America/Los Angeles"
    119,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/Louisville","America/Louisville"
    120,"BRT3BRST2,M10.2.0/0,M2.3.0/0","America/Maceio","America/Maceio"
    121,"CST6","America/Managua","America/Managua"
    122,"AMT4","America/Manaus","America/Manaus"
    123,"AST4","America/Martinique","America/Martinique"
    124,"MST7MDT6,M5.1.0/2,M9.5.0/2","America/Mazatlan","America/Mazatlan"
    125,"ART3","America/Mendoza","America/Mendoza"
    126,"CST6CDT5,M3.2.0/2,M11.1.0/2","America/Menominee","America/Menominee"
    127,"CST6CDT5,M5.1.0/2,M9.5.0/2","America/Merida","America/Merida"
    128,"CST6","America/Mexico City","America/Mexico City"
    129,"PMST3PMDT2,M3.2.0/2,M11.1.0/2","America/Miquelon","America/Miquelon"
    130,"CST6CDT5,M5.1.0/2,M9.5.0/2","America/Monterrey","America/Monterrey"
    131,"UYT3","America/Montevideo","America/Montevideo"
    132,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/Montreal","America/Montreal"
    133,"AST4","America/Montserrat","America/Montserrat"
    134,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/Nassau","America/Nassau"
    135,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/New York","America/New York"
    136,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/Nipigon","America/Nipigon"
    137,"AKST9AKDT8,M3.2.0/2,M11.1.0/2","America/Nome","America/Nome"
    138,"FNT2","America/Noronha","America/Noronha"
    139,"CST6CDT5,M3.2.0/2,M11.1.0/2","America/North Dakota/Center","America/North Dakota/Center"
    140,"EST5","America/Panama","America/Panama"
    141,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/Pangnirtung","America/Pangnirtung"
    142,"SRT3","America/Paramaribo","America/Paramaribo"
    143,"MST7","America/Phoenix","America/Phoenix"
    144,"AST4","America/Port of Spain","America/Port of Spain"
    145,"EST5","America/Port-au-Prince","America/Port-au-Prince"
    146,"ACT5","America/Porto Acre","America/Porto Acre"
    147,"AMT4","America/Porto Velho","America/Porto Velho"
    148,"AST4","America/Puerto Rico","America/Puerto Rico"
    149,"CST6CDT5,M3.2.0/2,M11.1.0/2","America/Rainy River","America/Rainy River"
    150,"CST6CDT5,M3.2.0/2,M11.1.0/2","America/Rankin Inlet","America/Rankin Inlet"
    151,"BRT3BRST2,M10.2.0/0,M2.3.0/0","America/Recife","America/Recife"
    152,"CST6","America/Regina","America/Regina"
    153,"ACT5","America/Rio Branco","America/Rio Branco"
    154,"ART3","America/Rosario","America/Rosario"
    155,"CLT4CLST3,M10.2.0/0,M3.2.0/0","America/Santiago","America/Santiago"
    156,"AST4","America/Santo Domingo","America/Santo Domingo"
    157,"BRT3BRST2,M10.2.0/0,M2.3.0/0","America/Sao Paulo","America/Sao Paulo"
    158,"EGT1EGST0,M3.5.0/0,M10.5.0/1","America/Scoresbysund","America/Scoresbysund"
    159,"MST7MDT6,M3.2.0/2,M11.1.0/2","America/Shiprock","America/Shiprock"
    160,"NST3:30NDT2:30,M3.2.0/0:01,M11.1.0/0:01","America/St Johns","America/St Johns"
    161,"AST4","America/St Kitts","America/St Kitts"
    162,"AST4","America/St Lucia","America/St Lucia"
    163,"AST4","America/St Thomas","America/St Thomas"
    164,"AST4","America/St Vincent","America/St Vincent"
    165,"CST6","America/Swift Current","America/Swift Current"
    166,"CST6","America/Tegucigalpa","America/Tegucigalpa"
    167,"AST4","America/Thule","America/Thule"
    168,"EST5EDT4,M3.2.0/2,M11.1.0/2","America/Thunder Bay","America/Thunder Bay"
    169,"PST8PDT7,M3.2.0/2,M11.1.0/2","America/Tijuana","America/Tijuana"
    170,"AST4","America/Tortola","America/Tortola"
    171,"PST8PDT7,M3.2.0/2,M11.1.0/2","America/Vancouver","America/Vancouver"
    172,"AST4","America/Virgin","America/Virgin"
    173,"PST8PDT7,M3.2.0/2,M11.1.0/2","America/Whitehorse","America/Whitehorse"
    174,"CST6CDT5,M3.2.0/2,M11.1.0/3","America/Winnipeg","America/Winnipeg"
    175,"AKST9AKDT8,M3.2.0/2,M11.1.0/2","America/Yakutat","America/Yakutat"
    176,"MST7MDT6,M3.2.0/2,M11.1.0/2","America/Yellowknife","America/Yellowknife"
    177,"WST-8","Antarctica/Casey","Antarctica/Casey"
    178,"DAVT-7","Antarctica/Davis","Antarctica/Davis"
    179,"DDUT-10","Antarctica/DumontDUrville","Antarctica/DumontDUrville"
    180,"MAWT-6","Antarctica/Mawson","Antarctica/Mawson"
    181,"NZST-12NZDT-13,M10.1.0/2,M3.3.0/3","Antarctica/McMurdo","Antarctica/McMurdo"
    182,"CLT4CLST3,M10.2.0/0,M3.2.0/0","Antarctica/Palmer","Antarctica/Palmer"
    183,"NZST-12NZDT-13,M10.1.0/2,M3.3.0/3","Antarctica/South Pole","Antarctica/South Pole"
    184,"SYOT-3","Antarctica/Syowa","Antarctica/Syowa"
    185,"VOST-6","Antarctica/Vostok","Antarctica/Vostok"
    186,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Arctic/Longyearbyen","Arctic/Longyearbyen"
    187,"AST-3","Asia/Aden","Asia/Aden"
    188,"ALMT-6ALMST-7,M3.5.0/0,M10.5.0/0","Asia/Almaty","Asia/Almaty"
    189,"EET-2EEST-3,M3.5.4/0,M9.5.4/1","Asia/Amman","Asia/Amman"
    190,"ANAT-12ANAST-13,M3.5.0/2,M10.5.0/3","Asia/Anadyr","Asia/Anadyr"
    191,"AQTT-4AQTST-5,M3.5.0/0,M10.5.0/0","Asia/Aqtau","Asia/Aqtau"
    192,"AQTT-5AQTST-6,M3.5.0/0,M10.5.0/0","Asia/Aqtobe","Asia/Aqtobe"
    193,"TMT-5","Asia/Ashgabat","Asia/Ashgabat"
    194,"TMT-5","Asia/Ashkhabad","Asia/Ashkhabad"
    195,"AST-3ADT-4,J91/3,J274/4","Asia/Baghdad","Asia/Baghdad"
    196,"AST-3","Asia/Bahrain","Asia/Bahrain"
    197,"AZT-4AZST-5,M3.5.0/1,M10.5.0/1","Asia/Baku","Asia/Baku"
    198,"ICT-7","Asia/Bangkok","Asia/Bangkok"
    199,"EET-2EEST-3,M3.5.0/0,M10.5.0/0","Asia/Beirut","Asia/Beirut"
    200,"KGT-5KGST-6,M3.5.0/2:30,M10.5.0/2:30","Asia/Bishkek","Asia/Bishkek"
    201,"BNT-8","Asia/Brunei","Asia/Brunei"
    202,"IST-5:30","Asia/Calcutta","Asia/Calcutta"
    203,"CHOT-9","Asia/Choibalsan","Asia/Choibalsan"
    204,"CST-8","Asia/Chongqing","Asia/Chongqing"
    205,"CST-8","Asia/Chungking","Asia/Chungking"
    206,"LKT-6","Asia/Colombo","Asia/Colombo"
    207,"BDT-6","Asia/Dacca","Asia/Dacca"
    208,"EET-2EEST-3,J91/0,J274/0","Asia/Damascus","Asia/Damascus"
    209,"BDT-6","Asia/Dhaka","Asia/Dhaka"
    210,"TPT-9","Asia/Dili","Asia/Dili"
    211,"GST-4","Asia/Dubai","Asia/Dubai"
    212,"TJT-5","Asia/Dushanbe","Asia/Dushanbe"
    213,"EET-2EEST-3,M4.3.5/0,M10.3.5/0","Asia/Gaza","Asia/Gaza"
    214,"CST-8","Asia/Harbin","Asia/Harbin"
    215,"HKT-8","Asia/Hong Kong","Asia/Hong Kong"
    216,"HOVT-7","Asia/Hovd","Asia/Hovd"
    217,"IRKT-8IRKST-9,M3.5.0/2,M10.5.0/3","Asia/Irkutsk","Asia/Irkutsk"
    218,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Asia/Istanbul","Asia/Istanbul"
    219,"WIT-7","Asia/Jakarta","Asia/Jakarta"
    220,"EIT-9","Asia/Jayapura","Asia/Jayapura"
    221,"IST-2IDT-3,J87/1,J276/1","Asia/Jerusalem","Asia/Jerusalem"
    222,"AFT-4:30","Asia/Kabul","Asia/Kabul"
    223,"PETT-12PETST-13,M3.5.0/2,M10.5.0/3","Asia/Kamchatka","Asia/Kamchatka"
    224,"PKT-5","Asia/Karachi","Asia/Karachi"
    225,"CST-8","Asia/Kashgar","Asia/Kashgar"
    226,"NPT-5:45","Asia/Katmandu","Asia/Katmandu"
    227,"KRAT-7KRAST-8,M3.5.0/2,M10.5.0/3","Asia/Krasnoyarsk","Asia/Krasnoyarsk"
    228,"MYT-8","Asia/Kuala Lumpur","Asia/Kuala Lumpur"
    229,"MYT-8","Asia/Kuching","Asia/Kuching"
    230,"AST-3","Asia/Kuwait","Asia/Kuwait"
    231,"CST-8","Asia/Macao","Asia/Macao"
    232,"MAGT-11MAGST-12,M3.5.0/2,M10.5.0/3","Asia/Magadan","Asia/Magadan"
    233,"PHT-8","Asia/Manila","Asia/Manila"
    234,"GST-4","Asia/Muscat","Asia/Muscat"
    235,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Asia/Nicosia","Asia/Nicosia"
    236,"NOVT-6NOVST-7,M3.5.0/2,M10.5.0/3","Asia/Novosibirsk","Asia/Novosibirsk"
    237,"OMST-6OMSST-7,M3.5.0/2,M10.5.0/3","Asia/Omsk","Asia/Omsk"
    238,"ICT-7","Asia/Phnom Penh","Asia/Phnom Penh"
    239,"WIT-7","Asia/Pontianak","Asia/Pontianak"
    240,"KST-9","Asia/Pyongyang","Asia/Pyongyang"
    241,"AST-3","Asia/Qatar","Asia/Qatar"
    242,"MMT-6:30","Asia/Rangoon","Asia/Rangoon"
    243,"AST-3","Asia/Riyadh","Asia/Riyadh"
    244,"ICT-7","Asia/Saigon","Asia/Saigon"
    245,"SAKT-10SAKST-11,M3.5.0/2,M10.5.0/3","Asia/Sakhalin","Asia/Sakhalin"
    246,"UZT-5","Asia/Samarkand","Asia/Samarkand"
    247,"KST-9","Asia/Seoul","Asia/Seoul"
    248,"CST-8","Asia/Shanghai","Asia/Shanghai"
    249,"SGT-8","Asia/Singapore","Asia/Singapore"
    250,"CST-8","Asia/Taipei","Asia/Taipei"
    251,"UZT-5","Asia/Tashkent","Asia/Tashkent"
    252,"GET-4GEST-5,M3.5.0/0,M10.5.0/0","Asia/Tbilisi","Asia/Tbilisi"
    253,"IRT-3:30IRST-4:30,J80/0,J266/0","Asia/Tehran","Asia/Tehran"
    254,"IST-2IDT-3,J87/1,J276/1","Asia/Tel Aviv","Asia/Tel Aviv"
    255,"BTT-6","Asia/Thimbu","Asia/Thimbu"
    256,"BTT-6","Asia/Thimphu","Asia/Thimphu"
    257,"JST-9","Asia/Tokyo","Asia/Tokyo"
    258,"CIT-8","Asia/Ujung Pandang","Asia/Ujung Pandang"
    259,"ULAT-8","Asia/Ulaanbaatar","Asia/Ulaanbaatar"
    260,"ULAT-8","Asia/Ulan Bator","Asia/Ulan Bator"
    261,"CST-8","Asia/Urumqi","Asia/Urumqi"
    262,"ICT-7","Asia/Vientiane","Asia/Vientiane"
    263,"VLAT-10VLAST-11,M3.5.0/2,M10.5.0/3","Asia/Vladivostok","Asia/Vladivostok"
    264,"YAKT-9YAKST-10,M3.5.0/2,M10.5.0/3","Asia/Yakutsk","Asia/Yakutsk"
    265,"YEKT-5YEKST-6,M3.5.0/2,M10.5.0/3","Asia/Yekaterinburg","Asia/Yekaterinburg"
    266,"AMT-4AMST-5,M3.5.0/2,M10.5.0/3","Asia/Yerevan","Asia/Yerevan"
    267,"AZOT1AZOST0,M3.5.0/0,M10.5.0/1","Atlantic/Azores","Atlantic/Azores"
    268,"AST4ADT3,M3.2.0/2,M11.1.0/2","Atlantic/Bermuda","Atlantic/Bermuda"
    269,"WET0WEST-1,M3.5.0/1,M10.5.0/2","Atlantic/Canary","Atlantic/Canary"
    270,"CVT1","Atlantic/Cape Verde","Atlantic/Cape Verde"
    271,"WET0WEST-1,M3.5.0/1,M10.5.0/2","Atlantic/Faeroe","Atlantic/Faeroe"
    272,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Atlantic/Jan Mayen","Atlantic/Jan Mayen"
    273,"WET0WEST-1,M3.5.0/1,M10.5.0/2","Atlantic/Madeira","Atlantic/Madeira"
    274,"GMT0","Atlantic/Reykjavik","Atlantic/Reykjavik"
    275,"GST2","Atlantic/South Georgia","Atlantic/South Georgia"
    276,"GMT0","Atlantic/St Helena","Atlantic/St Helena"
    277,"FKT4FKST3,M9.1.0/2,M4.3.0/2","Atlantic/Stanley","Atlantic/Stanley"
    278,"EST-10EDT-11,M10.5.0/2,M3.5.0/3","Australia/ACT","Australia/ACT"
    279,"CST-9:30CDT-10:30,M10.5.0/2,M3.5.0/3","Australia/Adelaide","Australia/Adelaide"
    280,"EST-10","Australia/Brisbane","Australia/Brisbane"
    281,"CST-9:30CDT-10:30,M10.5.0/2,M3.5.0/3","Australia/Broken Hill","Australia/Broken Hill"
    282,"EST-10EDT-11,M10.5.0/2,M3.5.0/3","Australia/Canberra","Australia/Canberra"
    283,"CST-9:30","Australia/Darwin","Australia/Darwin"
    284,"EST-10EDT-11,M10.1.0/2,M3.5.0/3","Australia/Hobart","Australia/Hobart"
    285,"LHST-10:30LHDT-11,M10.5.0/2,M3.5.0/2","Australia/LHI","Australia/LHI"
    286,"EST-10","Australia/Lindeman","Australia/Lindeman"
    287,"LHST-10:30LHDT-11,M10.5.0/2,M3.5.0/2","Australia/Lord Howe","Australia/Lord Howe"
    288,"EST-10EDT-11,M10.5.0/2,M3.5.0/3","Australia/Melbourne","Australia/Melbourne"
    289,"EST-10EDT-11,M10.5.0/2,M3.5.0/3","Australia/NSW","Australia/NSW"
    290,"CST-9:30","Australia/North","Australia/North"
    291,"WST-8","Australia/Perth","Australia/Perth"
    292,"EST-10","Australia/Queensland","Australia/Queensland"
    293,"CST-9:30CDT-10:30,M10.5.0/2,M3.5.0/3","Australia/South","Australia/South"
    294,"EST-10EDT-11,M10.5.0/2,M3.5.0/3","Australia/Sydney","Australia/Sydney"
    295,"EST-10EDT-11,M10.1.0/2,M3.5.0/3","Australia/Tasmania","Australia/Tasmania"
    296,"EST-10EDT-11,M10.5.0/2,M3.5.0/3","Australia/Victoria","Australia/Victoria"
    297,"WST-8","Australia/West","Australia/West"
    298,"CST-9:30CDT-10:30,M10.5.0/2,M3.5.0/3","Australia/Yancowinna","Australia/Yancowinna"
    299,"FNT2","Brazil/DeNoronha","Brazil/DeNoronha"
    300,"BRT3BRST2,M10.2.0/0,M2.3.0/0","Brazil/East","Brazil/East"
    301,"AMT4","Brazil/West","Brazil/West"
    302,"AST4ADT3,M3.2.0/2,M11.1.0/2","Canada/Atlantic","Canada/Atlantic"
    303,"CST6CDT5,M3.2.0/2,M11.1.0/3","Canada/Central","Canada/Central"
    304,"CST6","Canada/East-Saskatchewan","Canada/East-Saskatchewan"
    305,"EST5EDT4,M3.2.0/2,M11.1.0/2","Canada/Eastern","Canada/Eastern"
    306,"MST7MDT6,M3.2.0/2,M11.1.0/2","Canada/Mountain","Canada/Mountain"
    307,"NST3:30NDT2:30,M3.2.0/0:01,M11.1.0/0:01","Canada/Newfoundland","Canada/Newfoundland"
    308,"PST8PDT7,M3.2.0/2,M11.1.0/2","Canada/Pacific","Canada/Pacific"
    309,"CST6","Canada/Saskatchewan","Canada/Saskatchewan"
    310,"PST8PDT7,M3.2.0/2,M11.1.0/2","Canada/Yukon","Canada/Yukon"
    311,"CLT4CLST3,M10.2.0/0,M3.2.0/0","Chile/Continental","Chile/Continental"
    312,"EAST6EASST5,M10.2.0/-2,M3.2.0/-2","Chile/EasterIsland","Chile/EasterIsland"
    313,"CST5CDT4,M4.1.0/0,M10.5.0/1","Cuba","Cuba"
    314,"EET-2EEST-3,M4.5.5/0,M9.5.4/24","Egypt","Egypt"
    315,"GMT0IST-1,M3.5.0/1,M10.5.0/2","Eire","Eire"
    316,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Amsterdam","Europe/Amsterdam"
    317,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Andorra","Europe/Andorra"
    318,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Athens","Europe/Athens"
    319,"GMT0BST-1,M3.5.0/1,M10.5.0/2","Europe/Belfast","Europe/Belfast"
    320,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Belgrade","Europe/Belgrade"
    321,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Berlin","Europe/Berlin"
    322,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Bratislava","Europe/Bratislava"
    323,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Brussels","Europe/Brussels"
    324,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Bucharest","Europe/Bucharest"
    325,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Budapest","Europe/Budapest"
    326,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Chisinau","Europe/Chisinau"
    327,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Copenhagen","Europe/Copenhagen"
    328,"GMT0IST-1,M3.5.0/1,M10.5.0/2","Europe/Dublin","Europe/Dublin"
    329,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Gibraltar","Europe/Gibraltar"
    330,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Helsinki","Europe/Helsinki"
    331,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Istanbul","Europe/Istanbul"
    332,"EET-2EEST-3,M3.5.0/2,M10.5.0/3","Europe/Kaliningrad","Europe/Kaliningrad"
    333,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Kiev","Europe/Kiev"
    334,"WET0WEST-1,M3.5.0/1,M10.5.0/2","Europe/Lisbon","Europe/Lisbon"
    335,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Ljubljana","Europe/Ljubljana"
    336,"GMT0BST-1,M3.5.0/1,M10.5.0/2","Europe/London","Europe/London"
    337,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Luxembourg","Europe/Luxembourg"
    338,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Madrid","Europe/Madrid"
    339,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Malta","Europe/Malta"
    340,"EET-2EEST-3,M3.5.0/2,M10.5.0/3","Europe/Minsk","Europe/Minsk"
    341,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Monaco","Europe/Monaco"
    342,"MSK-3MSD-4,M3.5.0/2,M10.5.0/3","Europe/Moscow","Europe/Moscow"
    343,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Nicosia","Europe/Nicosia"
    344,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Oslo","Europe/Oslo"
    345,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Paris","Europe/Paris"
    346,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Prague","Europe/Prague"
    347,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Riga","Europe/Riga"
    348,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Rome","Europe/Rome"
    349,"SAMT-4SAMST-5,M3.5.0/2,M10.5.0/3","Europe/Samara","Europe/Samara"
    350,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/San Marino","Europe/San Marino"
    351,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Sarajevo","Europe/Sarajevo"
    352,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Simferopol","Europe/Simferopol"
    353,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Skopje","Europe/Skopje"
    354,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Sofia","Europe/Sofia"
    355,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Stockholm","Europe/Stockholm"
    356,"EET-2","Europe/Tallinn","Europe/Tallinn"
    357,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Tirane","Europe/Tirane"
    358,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Tiraspol","Europe/Tiraspol"
    359,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Uzhgorod","Europe/Uzhgorod"
    360,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Vaduz","Europe/Vaduz"
    361,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Vatican","Europe/Vatican"
    362,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Vienna","Europe/Vienna"
    363,"EET-2","Europe/Vilnius","Europe/Vilnius"
    364,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Warsaw","Europe/Warsaw"
    365,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Zagreb","Europe/Zagreb"
    366,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Europe/Zaporozhye","Europe/Zaporozhye"
    367,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Europe/Zurich","Europe/Zurich"
    368,"GMT0BST-1,M3.5.0/1,M10.5.0/2","Great Britain/Eire","Great Britain/Eire"
    369,"GMT0BST-1,M3.5.0/1,M10.5.0/2","Great Britain/Great Britain","Great Britain/Great Britain"
    370,"HKT-8","Hong Kong","Hong Kong"
    371,"GMT0","Iceland","Iceland"
    372,"EAT-3","Indian/Antananarivo","Indian/Antananarivo"
    373,"IOT-6","Indian/Chagos","Indian/Chagos"
    374,"CXT-7","Indian/Christmas","Indian/Christmas"
    375,"CCT-6:30","Indian/Cocos","Indian/Cocos"
    376,"EAT-3","Indian/Comoro","Indian/Comoro"
    377,"TFT-5","Indian/Kerguelen","Indian/Kerguelen"
    378,"SCT-4","Indian/Mahe","Indian/Mahe"
    379,"MVT-5","Indian/Maldives","Indian/Maldives"
    380,"MUT-4","Indian/Mauritius","Indian/Mauritius"
    381,"EAT-3","Indian/Mayotte","Indian/Mayotte"
    382,"RET-4","Indian/Reunion","Indian/Reunion"
    383,"IRT-3:30IRST-4:30,J80/0,J266/0","Iran","Iran"
    384,"IST-2IDT-3,J87/1,J276/1","Israel","Israel"
    385,"EST5","Jamaica","Jamaica"
    386,"JST-9","Japan","Japan"
    387,"MHT-12","Kwajalein","Kwajalein"
    388,"EET-2","Libya","Libya"
    389,"PST8PDT7,M3.2.0/2,M11.1.0/2","Mexico/BajaNorte","Mexico/BajaNorte"
    390,"MST7MDT6,M5.1.0/2,M9.5.0/2","Mexico/BajaSur","Mexico/BajaSur"
    391,"CST6","Mexico/General","Mexico/General"
    392,"MST7MDT6,M3.2.0/2,M11.1.0/2","Navajo","Navajo"
    393,"CHAST-12:45CHADT-13:45,M10.1.0/2:45,M3.3.0/3:45","New Zealand/Chatham","New Zealand/Chatham"
    394,"NZST-12NZDT-13,M10.1.0/2,M3.3.0/3","New Zealand/New Zealand","New Zealand/New Zealand"
    395,"WST11","Pacific/Apia","Pacific/Apia"
    396,"NZST-12NZDT-13,M10.1.0/2,M3.3.0/3","Pacific/Auckland","Pacific/Auckland"
    397,"CHAST-12:45CHADT-13:45,M10.1.0/2:45,M3.3.0/3:45","Pacific/Chatham","Pacific/Chatham"
    398,"EAST6EASST5,M10.2.0/-2,M3.2.0/-2","Pacific/Easter","Pacific/Easter"
    399,"VUT-11","Pacific/Efate","Pacific/Efate"
    400,"PHOT-13","Pacific/Enderbury","Pacific/Enderbury"
    401,"TKT10","Pacific/Fakaofo","Pacific/Fakaofo"
    402,"FJT-12","Pacific/Fiji","Pacific/Fiji"
    403,"TVT-12","Pacific/Funafuti","Pacific/Funafuti"
    404,"GALT6","Pacific/Galapagos","Pacific/Galapagos"
    405,"GAMT9","Pacific/Gambier","Pacific/Gambier"
    406,"SBT-11","Pacific/Guadalcanal","Pacific/Guadalcanal"
    407,"ChST-10","Pacific/Guam","Pacific/Guam"
    408,"HST10","Pacific/Honolulu","Pacific/Honolulu"
    409,"HST10","Pacific/Johnston","Pacific/Johnston"
    410,"LINT-14","Pacific/Kiritimati","Pacific/Kiritimati"
    411,"KOST-11","Pacific/Kosrae","Pacific/Kosrae"
    412,"MHT-12","Pacific/Kwajalein","Pacific/Kwajalein"
    413,"MHT-12","Pacific/Majuro","Pacific/Majuro"
    414,"MART9:30","Pacific/Marquesas","Pacific/Marquesas"
    415,"SST11","Pacific/Midway","Pacific/Midway"
    416,"NRT-12","Pacific/Nauru","Pacific/Nauru"
    417,"NUT11","Pacific/Niue","Pacific/Niue"
    418,"NFT-11:30","Pacific/Norfolk","Pacific/Norfolk"
    419,"NCT-11","Pacific/Noumea","Pacific/Noumea"
    420,"SST11","Pacific/Pago Pago","Pacific/Pago Pago"
    421,"PWT-9","Pacific/Palau","Pacific/Palau"
    422,"PST8","Pacific/Pitcairn","Pacific/Pitcairn"
    423,"PONT-11","Pacific/Ponape","Pacific/Ponape"
    424,"PGT-10","Pacific/Port Moresby","Pacific/Port Moresby"
    425,"CKT10","Pacific/Rarotonga","Pacific/Rarotonga"
    426,"ChST-10","Pacific/Saipan","Pacific/Saipan"
    427,"SST11","Pacific/Samoa","Pacific/Samoa"
    428,"TAHT10","Pacific/Tahiti","Pacific/Tahiti"
    429,"GILT-12","Pacific/Tarawa","Pacific/Tarawa"
    430,"TOT-13","Pacific/Tongatapu","Pacific/Tongatapu"
    431,"TRUT-10","Pacific/Truk","Pacific/Truk"
    432,"WAKT-12","Pacific/Wake","Pacific/Wake"
    433,"WFT-12","Pacific/Wallis","Pacific/Wallis"
    434,"YAPT-10","Pacific/Yap","Pacific/Yap"
    435,"CET-1CEST-2,M3.5.0/2,M10.5.0/3","Poland","Poland"
    436,"WET0WEST-1,M3.5.0/1,M10.5.0/2","Portugal","Portugal"
    437,"SGT-8","Singapore","Singapore"
    438,"EET-2EEST-3,M3.5.0/3,M10.5.0/4","Turkey","Turkey"
    439,"AKST9AKDT8,M3.2.0/2,M11.1.0/2","US/Alaska","US/Alaska"
    440,"HAST10HADT9,M3.2.0/2,M11.1.0/2","US/Aleutian","US/Aleutian"
    441,"MST7","US/Arizona","US/Arizona"
    442,"CST6CDT5,M3.2.0/2,M11.1.0/2","US/Central","US/Central"
    443,"EST5","US/East-Indiana","US/East-Indiana"
    444,"EST5EDT4,M3.2.0/2,M11.1.0/2","US/Eastern","US/Eastern"
    445,"HST10","US/Hawaii","US/Hawaii"
    446,"EST5","US/Indiana-Starke","US/Indiana-Starke"
    447,"EST5EDT4,M3.2.0/2,M11.1.0/2","US/Michigan","US/Michigan"
    448,"MST7MDT6,M3.2.0/2,M11.1.0/2","US/Mountain","US/Mountain"
    449,"PST8PDT7,M3.2.0/2,M11.1.0/2","US/Pacific","US/Pacific"
    450,"SST11","US/Samoa","US/Samoa"
    

  • You don't need to maintain them maintain them: 

    Use prior art to generate a class/module that has all the data

    github.com/.../tools

    Also, Garmin has the data. My watch has several timezone thingies. I have local time UTC-0400 and my folks which are UTC+0200 which are both displayed on my watch. So why not RFC the exposure of these timezone settings that the FW already has?

  • You don't need to maintain them maintain them: 

    Use prior art to generate a class/module that has all the data

    I agree. (My old list was for an embedded system that was updated like once a year. Part of the motivation for posting it was to demonstrate the scope of the data. The part of the work I didn't show you was where I reverse-mapped a subset of the data to the list of Windows time zones, in conjunction with auto-detecting the local time zone, to satisfy my bosses.)

    The only part is that all the full, authoritative sources have way too much data (*), so the real manual labor is whittling the list down to the timezones you actually care about, like some subset of the time zones that Windows lets you manually choose from.

    (* even pytz's "common_timezones" list still has like 403 items)

    Or maybe OP's 31 timezones is the list they already need, so they just need to cross-reference with the corresponding zones in my list, and maybe grab a few of the oddball exceptions to the rules.

    Then once you've got the time zones you want in the format you want, then you set up a script to automatically update and regenerate your time zone data at will.

  • So why not RFC the exposure of these timezone settings that the FW already has?

    Yeah, Garmin has lots of stuff they don't share with devs. That would be a nice feature request, but I wouldn't hold my breath.

    I also think implementing this kind of thing can be a good learning experience, although of course nobody wants to be constantly reinventing the wheel.

  • I didnt see your response flow, i was still on page one when I typed it :)

  • If you dont ask you never know

  • Sorry to resurrect this thread, but for System 5 devices (CIQ >= 3.3 for CIQ 3.* and CIQ >= 4.1 for CIQ 4.*), there actually is a way to do this without maintaining your own TZ database - you can use a LocalMoment.

    (I have no idea why the docs say that devices such as Fenix 5 Plus are supported, but they also say that the minimum API level is 3.3, unless CIQ 3.3 is coming to fenix 5 plus, which seems unlikely)

    https://developer.garmin.com/connect-iq/api-docs/Toybox/Time/LocalMoment.html

    A LocalMoment is an immutable moment in time.

    LocalMoment represents a single point in time at a specific location. It differs from Moment in that it also keeps time zone information in addition to the time.

    So you could:

    - Create a list of timezones you care about (again this could be as small as a few dozen).

    - Map each of the timezones to a location (coordinates)

    - Use LocalMoment to get the local time in that location

    This approach would be much more feasible than the other approach of maintaining/transforming the timezone data yourself. The huge downside is it would only work for newer devices.