libPocuter 1.0 Support library for programming the Pocuter

PocuterTime.h
Go to the documentation of this file.
1 #ifndef POCUTER_DISABLE_TIME
2 #ifndef POCUTERTIME_H
3 #define POCUTERTIME_H
4 #include <time.h>
5 #define TIME_ZONES_COUNT 461
6
10 class PocuterTime {
11 public:
12 enum TIMEERROR {
13 TIMEERROR_OK = 0,
14 TIMEERROR_FAILED = 1,
15
16
17 TIMEERROR_UNKNOWN
18
19
20 };
21 struct pocuterTimezone {
22 const char* name;
23 const char* timezoneString;
24 };
25 #define TIME_ZONES_COUNT 461
26 const pocuterTimezone c_tz[TIME_ZONES_COUNT] = {
27 { .name = "Africa/Abidjan", .timezoneString = "GMT0" },
28 { .name = "Africa/Accra", .timezoneString = "GMT0" },
29 { .name = "Africa/Addis_Ababa", .timezoneString = "EAT-3" },
30 { .name = "Africa/Algiers", .timezoneString = "CET-1" },
31 { .name = "Africa/Asmara", .timezoneString = "EAT-3" },
32 { .name = "Africa/Bamako", .timezoneString = "GMT0" },
33 { .name = "Africa/Bangui", .timezoneString = "WAT-1" },
34 { .name = "Africa/Banjul", .timezoneString = "GMT0" },
35 { .name = "Africa/Bissau", .timezoneString = "GMT0" },
36 { .name = "Africa/Blantyre", .timezoneString = "CAT-2" },
37 { .name = "Africa/Brazzaville", .timezoneString = "WAT-1" },
38 { .name = "Africa/Bujumbura", .timezoneString = "CAT-2" },
39 { .name = "Africa/Cairo", .timezoneString = "EET-2" },
40 { .name = "Africa/Casablanca", .timezoneString = "<+01>-1" },
41 { .name = "Africa/Ceuta", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
42 { .name = "Africa/Conakry", .timezoneString = "GMT0" },
43 { .name = "Africa/Dakar", .timezoneString = "GMT0" },
44 { .name = "Africa/Dar_es_Salaam", .timezoneString = "EAT-3" },
45 { .name = "Africa/Djibouti", .timezoneString = "EAT-3" },
46 { .name = "Africa/Douala", .timezoneString = "WAT-1" },
47 { .name = "Africa/El_Aaiun", .timezoneString = "<+01>-1" },
48 { .name = "Africa/Freetown", .timezoneString = "GMT0" },
49 { .name = "Africa/Gaborone", .timezoneString = "CAT-2" },
50 { .name = "Africa/Harare", .timezoneString = "CAT-2" },
51 { .name = "Africa/Johannesburg", .timezoneString = "SAST-2" },
52 { .name = "Africa/Juba", .timezoneString = "CAT-2" },
53 { .name = "Africa/Kampala", .timezoneString = "EAT-3" },
54 { .name = "Africa/Khartoum", .timezoneString = "CAT-2" },
55 { .name = "Africa/Kigali", .timezoneString = "CAT-2" },
56 { .name = "Africa/Kinshasa", .timezoneString = "WAT-1" },
57 { .name = "Africa/Lagos", .timezoneString = "WAT-1" },
58 { .name = "Africa/Libreville", .timezoneString = "WAT-1" },
59 { .name = "Africa/Lome", .timezoneString = "GMT0" },
60 { .name = "Africa/Luanda", .timezoneString = "WAT-1" },
61 { .name = "Africa/Lubumbashi", .timezoneString = "CAT-2" },
62 { .name = "Africa/Lusaka", .timezoneString = "CAT-2" },
63 { .name = "Africa/Malabo", .timezoneString = "WAT-1" },
64 { .name = "Africa/Maputo", .timezoneString = "CAT-2" },
65 { .name = "Africa/Maseru", .timezoneString = "SAST-2" },
66 { .name = "Africa/Mbabane", .timezoneString = "SAST-2" },
67 { .name = "Africa/Mogadishu", .timezoneString = "EAT-3" },
68 { .name = "Africa/Monrovia", .timezoneString = "GMT0" },
69 { .name = "Africa/Nairobi", .timezoneString = "EAT-3" },
70 { .name = "Africa/Ndjamena", .timezoneString = "WAT-1" },
71 { .name = "Africa/Niamey", .timezoneString = "WAT-1" },
72 { .name = "Africa/Nouakchott", .timezoneString = "GMT0" },
73 { .name = "Africa/Ouagadougou", .timezoneString = "GMT0" },
74 { .name = "Africa/Porto-Novo", .timezoneString = "WAT-1" },
75 { .name = "Africa/Sao_Tome", .timezoneString = "GMT0" },
76 { .name = "Africa/Tripoli", .timezoneString = "EET-2" },
77 { .name = "Africa/Tunis", .timezoneString = "CET-1" },
78 { .name = "Africa/Windhoek", .timezoneString = "CAT-2" },
79 { .name = "America/Adak", .timezoneString = "HST10HDT,M3.2.0,M11.1.0" },
80 { .name = "America/Anchorage", .timezoneString = "AKST9AKDT,M3.2.0,M11.1.0" },
81 { .name = "America/Anguilla", .timezoneString = "AST4" },
82 { .name = "America/Antigua", .timezoneString = "AST4" },
83 { .name = "America/Araguaina", .timezoneString = "<-03>3" },
84 { .name = "America/Argentina/Buenos_Aires", .timezoneString = "<-03>3" },
85 { .name = "America/Argentina/Catamarca", .timezoneString = "<-03>3" },
86 { .name = "America/Argentina/Cordoba", .timezoneString = "<-03>3" },
87 { .name = "America/Argentina/Jujuy", .timezoneString = "<-03>3" },
88 { .name = "America/Argentina/La_Rioja", .timezoneString = "<-03>3" },
89 { .name = "America/Argentina/Mendoza", .timezoneString = "<-03>3" },
90 { .name = "America/Argentina/Rio_Gallegos", .timezoneString = "<-03>3" },
91 { .name = "America/Argentina/Salta", .timezoneString = "<-03>3" },
92 { .name = "America/Argentina/San_Juan", .timezoneString = "<-03>3" },
93 { .name = "America/Argentina/San_Luis", .timezoneString = "<-03>3" },
94 { .name = "America/Argentina/Tucuman", .timezoneString = "<-03>3" },
95 { .name = "America/Argentina/Ushuaia", .timezoneString = "<-03>3" },
96 { .name = "America/Aruba", .timezoneString = "AST4" },
97 { .name = "America/Asuncion", .timezoneString = "<-04>4<-03>,M10.1.0/0,M3.4.0/0" },
98 { .name = "America/Atikokan", .timezoneString = "EST5" },
99 { .name = "America/Bahia", .timezoneString = "<-03>3" },
100 { .name = "America/Bahia_Banderas", .timezoneString = "CST6CDT,M4.1.0,M10.5.0" },
101 { .name = "America/Barbados", .timezoneString = "AST4" },
102 { .name = "America/Belem", .timezoneString = "<-03>3" },
103 { .name = "America/Belize", .timezoneString = "CST6" },
104 { .name = "America/Blanc-Sablon", .timezoneString = "AST4" },
105 { .name = "America/Boa_Vista", .timezoneString = "<-04>4" },
106 { .name = "America/Bogota", .timezoneString = "<-05>5" },
107 { .name = "America/Boise", .timezoneString = "MST7MDT,M3.2.0,M11.1.0" },
108 { .name = "America/Cambridge_Bay", .timezoneString = "MST7MDT,M3.2.0,M11.1.0" },
109 { .name = "America/Campo_Grande", .timezoneString = "<-04>4" },
110 { .name = "America/Cancun", .timezoneString = "EST5" },
111 { .name = "America/Caracas", .timezoneString = "<-04>4" },
112 { .name = "America/Cayenne", .timezoneString = "<-03>3" },
113 { .name = "America/Cayman", .timezoneString = "EST5" },
114 { .name = "America/Chicago", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
115 { .name = "America/Chihuahua", .timezoneString = "MST7MDT,M4.1.0,M10.5.0" },
116 { .name = "America/Costa_Rica", .timezoneString = "CST6" },
117 { .name = "America/Creston", .timezoneString = "MST7" },
118 { .name = "America/Cuiaba", .timezoneString = "<-04>4" },
119 { .name = "America/Curacao", .timezoneString = "AST4" },
120 { .name = "America/Danmarkshavn", .timezoneString = "GMT0" },
121 { .name = "America/Dawson", .timezoneString = "MST7" },
122 { .name = "America/Dawson_Creek", .timezoneString = "MST7" },
123 { .name = "America/Denver", .timezoneString = "MST7MDT,M3.2.0,M11.1.0" },
124 { .name = "America/Detroit", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
125 { .name = "America/Dominica", .timezoneString = "AST4" },
126 { .name = "America/Edmonton", .timezoneString = "MST7MDT,M3.2.0,M11.1.0" },
127 { .name = "America/Eirunepe", .timezoneString = "<-05>5" },
128 { .name = "America/El_Salvador", .timezoneString = "CST6" },
129 { .name = "America/Fortaleza", .timezoneString = "<-03>3" },
130 { .name = "America/Fort_Nelson", .timezoneString = "MST7" },
131 { .name = "America/Glace_Bay", .timezoneString = "AST4ADT,M3.2.0,M11.1.0" },
132 { .name = "America/Godthab", .timezoneString = "<-03>3<-02>,M3.5.0/-2,M10.5.0/-1" },
133 { .name = "America/Goose_Bay", .timezoneString = "AST4ADT,M3.2.0,M11.1.0" },
134 { .name = "America/Grand_Turk", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
135 { .name = "America/Grenada", .timezoneString = "AST4" },
136 { .name = "America/Guadeloupe", .timezoneString = "AST4" },
137 { .name = "America/Guatemala", .timezoneString = "CST6" },
138 { .name = "America/Guayaquil", .timezoneString = "<-05>5" },
139 { .name = "America/Guyana", .timezoneString = "<-04>4" },
140 { .name = "America/Halifax", .timezoneString = "AST4ADT,M3.2.0,M11.1.0" },
141 { .name = "America/Havana", .timezoneString = "CST5CDT,M3.2.0/0,M11.1.0/1" },
142 { .name = "America/Hermosillo", .timezoneString = "MST7" },
143 { .name = "America/Indiana/Indianapolis", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
144 { .name = "America/Indiana/Knox", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
145 { .name = "America/Indiana/Marengo", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
146 { .name = "America/Indiana/Petersburg", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
147 { .name = "America/Indiana/Tell_City", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
148 { .name = "America/Indiana/Vevay", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
149 { .name = "America/Indiana/Vincennes", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
150 { .name = "America/Indiana/Winamac", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
151 { .name = "America/Inuvik", .timezoneString = "MST7MDT,M3.2.0,M11.1.0" },
152 { .name = "America/Iqaluit", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
153 { .name = "America/Jamaica", .timezoneString = "EST5" },
154 { .name = "America/Juneau", .timezoneString = "AKST9AKDT,M3.2.0,M11.1.0" },
155 { .name = "America/Kentucky/Louisville", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
156 { .name = "America/Kentucky/Monticello", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
157 { .name = "America/Kralendijk", .timezoneString = "AST4" },
158 { .name = "America/La_Paz", .timezoneString = "<-04>4" },
159 { .name = "America/Lima", .timezoneString = "<-05>5" },
160 { .name = "America/Los_Angeles", .timezoneString = "PST8PDT,M3.2.0,M11.1.0" },
161 { .name = "America/Lower_Princes", .timezoneString = "AST4" },
162 { .name = "America/Maceio", .timezoneString = "<-03>3" },
163 { .name = "America/Managua", .timezoneString = "CST6" },
164 { .name = "America/Manaus", .timezoneString = "<-04>4" },
165 { .name = "America/Marigot", .timezoneString = "AST4" },
166 { .name = "America/Martinique", .timezoneString = "AST4" },
167 { .name = "America/Matamoros", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
168 { .name = "America/Mazatlan", .timezoneString = "MST7MDT,M4.1.0,M10.5.0" },
169 { .name = "America/Menominee", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
170 { .name = "America/Merida", .timezoneString = "CST6CDT,M4.1.0,M10.5.0" },
171 { .name = "America/Metlakatla", .timezoneString = "AKST9AKDT,M3.2.0,M11.1.0" },
172 { .name = "America/Mexico_City", .timezoneString = "CST6CDT,M4.1.0,M10.5.0" },
173 { .name = "America/Miquelon", .timezoneString = "<-03>3<-02>,M3.2.0,M11.1.0" },
174 { .name = "America/Moncton", .timezoneString = "AST4ADT,M3.2.0,M11.1.0" },
175 { .name = "America/Monterrey", .timezoneString = "CST6CDT,M4.1.0,M10.5.0" },
176 { .name = "America/Montevideo", .timezoneString = "<-03>3" },
177 { .name = "America/Montreal", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
178 { .name = "America/Montserrat", .timezoneString = "AST4" },
179 { .name = "America/Nassau", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
180 { .name = "America/New_York", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
181 { .name = "America/Nipigon", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
182 { .name = "America/Nome", .timezoneString = "AKST9AKDT,M3.2.0,M11.1.0" },
183 { .name = "America/Noronha", .timezoneString = "<-02>2" },
184 { .name = "America/North_Dakota/Beulah", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
185 { .name = "America/North_Dakota/Center", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
186 { .name = "America/North_Dakota/New_Salem", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
187 { .name = "America/Nuuk", .timezoneString = "<-03>3<-02>,M3.5.0/-2,M10.5.0/-1" },
188 { .name = "America/Ojinaga", .timezoneString = "MST7MDT,M3.2.0,M11.1.0" },
189 { .name = "America/Panama", .timezoneString = "EST5" },
190 { .name = "America/Pangnirtung", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
191 { .name = "America/Paramaribo", .timezoneString = "<-03>3" },
192 { .name = "America/Phoenix", .timezoneString = "MST7" },
193 { .name = "America/Port-au-Prince", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
194 { .name = "America/Port_of_Spain", .timezoneString = "AST4" },
195 { .name = "America/Porto_Velho", .timezoneString = "<-04>4" },
196 { .name = "America/Puerto_Rico", .timezoneString = "AST4" },
197 { .name = "America/Punta_Arenas", .timezoneString = "<-03>3" },
198 { .name = "America/Rainy_River", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
199 { .name = "America/Rankin_Inlet", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
200 { .name = "America/Recife", .timezoneString = "<-03>3" },
201 { .name = "America/Regina", .timezoneString = "CST6" },
202 { .name = "America/Resolute", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
203 { .name = "America/Rio_Branco", .timezoneString = "<-05>5" },
204 { .name = "America/Santarem", .timezoneString = "<-03>3" },
205 { .name = "America/Santiago", .timezoneString = "<-04>4<-03>,M9.1.6/24,M4.1.6/24" },
206 { .name = "America/Santo_Domingo", .timezoneString = "AST4" },
207 { .name = "America/Sao_Paulo", .timezoneString = "<-03>3" },
208 { .name = "America/Scoresbysund", .timezoneString = "<-01>1<+00>,M3.5.0/0,M10.5.0/1" },
209 { .name = "America/Sitka", .timezoneString = "AKST9AKDT,M3.2.0,M11.1.0" },
210 { .name = "America/St_Barthelemy", .timezoneString = "AST4" },
211 { .name = "America/St_Johns", .timezoneString = "NST3:30NDT,M3.2.0,M11.1.0" },
212 { .name = "America/St_Kitts", .timezoneString = "AST4" },
213 { .name = "America/St_Lucia", .timezoneString = "AST4" },
214 { .name = "America/St_Thomas", .timezoneString = "AST4" },
215 { .name = "America/St_Vincent", .timezoneString = "AST4" },
216 { .name = "America/Swift_Current", .timezoneString = "CST6" },
217 { .name = "America/Tegucigalpa", .timezoneString = "CST6" },
218 { .name = "America/Thule", .timezoneString = "AST4ADT,M3.2.0,M11.1.0" },
219 { .name = "America/Thunder_Bay", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
220 { .name = "America/Tijuana", .timezoneString = "PST8PDT,M3.2.0,M11.1.0" },
221 { .name = "America/Toronto", .timezoneString = "EST5EDT,M3.2.0,M11.1.0" },
222 { .name = "America/Tortola", .timezoneString = "AST4" },
223 { .name = "America/Vancouver", .timezoneString = "PST8PDT,M3.2.0,M11.1.0" },
224 { .name = "America/Whitehorse", .timezoneString = "MST7" },
225 { .name = "America/Winnipeg", .timezoneString = "CST6CDT,M3.2.0,M11.1.0" },
226 { .name = "America/Yakutat", .timezoneString = "AKST9AKDT,M3.2.0,M11.1.0" },
227 { .name = "America/Yellowknife", .timezoneString = "MST7MDT,M3.2.0,M11.1.0" },
228 { .name = "Antarctica/Casey", .timezoneString = "<+11>-11" },
229 { .name = "Antarctica/Davis", .timezoneString = "<+07>-7" },
230 { .name = "Antarctica/DumontDUrville", .timezoneString = "<+10>-10" },
231 { .name = "Antarctica/Macquarie", .timezoneString = "AEST-10AEDT,M10.1.0,M4.1.0/3" },
232 { .name = "Antarctica/Mawson", .timezoneString = "<+05>-5" },
233 { .name = "Antarctica/McMurdo", .timezoneString = "NZST-12NZDT,M9.5.0,M4.1.0/3" },
234 { .name = "Antarctica/Palmer", .timezoneString = "<-03>3" },
235 { .name = "Antarctica/Rothera", .timezoneString = "<-03>3" },
236 { .name = "Antarctica/Syowa", .timezoneString = "<+03>-3" },
237 { .name = "Antarctica/Troll", .timezoneString = "<+00>0<+02>-2,M3.5.0/1,M10.5.0/3" },
238 { .name = "Antarctica/Vostok", .timezoneString = "<+06>-6" },
239 { .name = "Arctic/Longyearbyen", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
240 { .name = "Asia/Aden", .timezoneString = "<+03>-3" },
241 { .name = "Asia/Almaty", .timezoneString = "<+06>-6" },
242 { .name = "Asia/Amman", .timezoneString = "EET-2EEST,M2.5.4/24,M10.5.5/1" },
243 { .name = "Asia/Anadyr", .timezoneString = "<+12>-12" },
244 { .name = "Asia/Aqtau", .timezoneString = "<+05>-5" },
245 { .name = "Asia/Aqtobe", .timezoneString = "<+05>-5" },
246 { .name = "Asia/Ashgabat", .timezoneString = "<+05>-5" },
247 { .name = "Asia/Atyrau", .timezoneString = "<+05>-5" },
248 { .name = "Asia/Baghdad", .timezoneString = "<+03>-3" },
249 { .name = "Asia/Bahrain", .timezoneString = "<+03>-3" },
250 { .name = "Asia/Baku", .timezoneString = "<+04>-4" },
251 { .name = "Asia/Bangkok", .timezoneString = "<+07>-7" },
252 { .name = "Asia/Barnaul", .timezoneString = "<+07>-7" },
253 { .name = "Asia/Beirut", .timezoneString = "EET-2EEST,M3.5.0/0,M10.5.0/0" },
254 { .name = "Asia/Bishkek", .timezoneString = "<+06>-6" },
255 { .name = "Asia/Brunei", .timezoneString = "<+08>-8" },
256 { .name = "Asia/Chita", .timezoneString = "<+09>-9" },
257 { .name = "Asia/Choibalsan", .timezoneString = "<+08>-8" },
258 { .name = "Asia/Colombo", .timezoneString = "<+0530>-5:30" },
259 { .name = "Asia/Damascus", .timezoneString = "EET-2EEST,M3.5.5/0,M10.5.5/0" },
260 { .name = "Asia/Dhaka", .timezoneString = "<+06>-6" },
261 { .name = "Asia/Dili", .timezoneString = "<+09>-9" },
262 { .name = "Asia/Dubai", .timezoneString = "<+04>-4" },
263 { .name = "Asia/Dushanbe", .timezoneString = "<+05>-5" },
264 { .name = "Asia/Famagusta", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
265 { .name = "Asia/Gaza", .timezoneString = "EET-2EEST,M3.4.4/48,M10.5.5/1" },
266 { .name = "Asia/Hebron", .timezoneString = "EET-2EEST,M3.4.4/48,M10.5.5/1" },
267 { .name = "Asia/Ho_Chi_Minh", .timezoneString = "<+07>-7" },
268 { .name = "Asia/Hong_Kong", .timezoneString = "HKT-8" },
269 { .name = "Asia/Hovd", .timezoneString = "<+07>-7" },
270 { .name = "Asia/Irkutsk", .timezoneString = "<+08>-8" },
271 { .name = "Asia/Jakarta", .timezoneString = "WIB-7" },
272 { .name = "Asia/Jayapura", .timezoneString = "WIT-9" },
273 { .name = "Asia/Jerusalem", .timezoneString = "IST-2IDT,M3.4.4/26,M10.5.0" },
274 { .name = "Asia/Kabul", .timezoneString = "<+0430>-4:30" },
275 { .name = "Asia/Kamchatka", .timezoneString = "<+12>-12" },
276 { .name = "Asia/Karachi", .timezoneString = "PKT-5" },
277 { .name = "Asia/Kathmandu", .timezoneString = "<+0545>-5:45" },
278 { .name = "Asia/Khandyga", .timezoneString = "<+09>-9" },
279 { .name = "Asia/Kolkata", .timezoneString = "IST-5:30" },
280 { .name = "Asia/Krasnoyarsk", .timezoneString = "<+07>-7" },
281 { .name = "Asia/Kuala_Lumpur", .timezoneString = "<+08>-8" },
282 { .name = "Asia/Kuching", .timezoneString = "<+08>-8" },
283 { .name = "Asia/Kuwait", .timezoneString = "<+03>-3" },
284 { .name = "Asia/Macau", .timezoneString = "CST-8" },
285 { .name = "Asia/Magadan", .timezoneString = "<+11>-11" },
286 { .name = "Asia/Makassar", .timezoneString = "WITA-8" },
287 { .name = "Asia/Manila", .timezoneString = "PST-8" },
288 { .name = "Asia/Muscat", .timezoneString = "<+04>-4" },
289 { .name = "Asia/Nicosia", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
290 { .name = "Asia/Novokuznetsk", .timezoneString = "<+07>-7" },
291 { .name = "Asia/Novosibirsk", .timezoneString = "<+07>-7" },
292 { .name = "Asia/Omsk", .timezoneString = "<+06>-6" },
293 { .name = "Asia/Oral", .timezoneString = "<+05>-5" },
294 { .name = "Asia/Phnom_Penh", .timezoneString = "<+07>-7" },
295 { .name = "Asia/Pontianak", .timezoneString = "WIB-7" },
296 { .name = "Asia/Pyongyang", .timezoneString = "KST-9" },
297 { .name = "Asia/Qatar", .timezoneString = "<+03>-3" },
298 { .name = "Asia/Qyzylorda", .timezoneString = "<+05>-5" },
299 { .name = "Asia/Riyadh", .timezoneString = "<+03>-3" },
300 { .name = "Asia/Sakhalin", .timezoneString = "<+11>-11" },
301 { .name = "Asia/Samarkand", .timezoneString = "<+05>-5" },
302 { .name = "Asia/Seoul", .timezoneString = "KST-9" },
303 { .name = "Asia/Shanghai", .timezoneString = "CST-8" },
304 { .name = "Asia/Singapore", .timezoneString = "<+08>-8" },
305 { .name = "Asia/Srednekolymsk", .timezoneString = "<+11>-11" },
306 { .name = "Asia/Taipei", .timezoneString = "CST-8" },
307 { .name = "Asia/Tashkent", .timezoneString = "<+05>-5" },
308 { .name = "Asia/Tbilisi", .timezoneString = "<+04>-4" },
309 { .name = "Asia/Tehran", .timezoneString = "<+0330>-3:30<+0430>,J79/24,J263/24" },
310 { .name = "Asia/Thimphu", .timezoneString = "<+06>-6" },
311 { .name = "Asia/Tokyo", .timezoneString = "JST-9" },
312 { .name = "Asia/Tomsk", .timezoneString = "<+07>-7" },
313 { .name = "Asia/Ulaanbaatar", .timezoneString = "<+08>-8" },
314 { .name = "Asia/Urumqi", .timezoneString = "<+06>-6" },
315 { .name = "Asia/Ust-Nera", .timezoneString = "<+10>-10" },
316 { .name = "Asia/Vientiane", .timezoneString = "<+07>-7" },
317 { .name = "Asia/Vladivostok", .timezoneString = "<+10>-10" },
318 { .name = "Asia/Yakutsk", .timezoneString = "<+09>-9" },
319 { .name = "Asia/Yangon", .timezoneString = "<+0630>-6:30" },
320 { .name = "Asia/Yekaterinburg", .timezoneString = "<+05>-5" },
321 { .name = "Asia/Yerevan", .timezoneString = "<+04>-4" },
322 { .name = "Atlantic/Azores", .timezoneString = "<-01>1<+00>,M3.5.0/0,M10.5.0/1" },
323 { .name = "Atlantic/Bermuda", .timezoneString = "AST4ADT,M3.2.0,M11.1.0" },
324 { .name = "Atlantic/Canary", .timezoneString = "WET0WEST,M3.5.0/1,M10.5.0" },
325 { .name = "Atlantic/Cape_Verde", .timezoneString = "<-01>1" },
326 { .name = "Atlantic/Faroe", .timezoneString = "WET0WEST,M3.5.0/1,M10.5.0" },
327 { .name = "Atlantic/Madeira", .timezoneString = "WET0WEST,M3.5.0/1,M10.5.0" },
328 { .name = "Atlantic/Reykjavik", .timezoneString = "GMT0" },
329 { .name = "Atlantic/South_Georgia", .timezoneString = "<-02>2" },
330 { .name = "Atlantic/Stanley", .timezoneString = "<-03>3" },
331 { .name = "Atlantic/St_Helena", .timezoneString = "GMT0" },
332 { .name = "Australia/Adelaide", .timezoneString = "ACST-9:30ACDT,M10.1.0,M4.1.0/3" },
333 { .name = "Australia/Brisbane", .timezoneString = "AEST-10" },
334 { .name = "Australia/Broken_Hill", .timezoneString = "ACST-9:30ACDT,M10.1.0,M4.1.0/3" },
335 { .name = "Australia/Currie", .timezoneString = "AEST-10AEDT,M10.1.0,M4.1.0/3" },
336 { .name = "Australia/Darwin", .timezoneString = "ACST-9:30" },
337 { .name = "Australia/Eucla", .timezoneString = "<+0845>-8:45" },
338 { .name = "Australia/Hobart", .timezoneString = "AEST-10AEDT,M10.1.0,M4.1.0/3" },
339 { .name = "Australia/Lindeman", .timezoneString = "AEST-10" },
340 { .name = "Australia/Lord_Howe", .timezoneString = "<+1030>-10:30<+11>-11,M10.1.0,M4.1.0" },
341 { .name = "Australia/Melbourne", .timezoneString = "AEST-10AEDT,M10.1.0,M4.1.0/3" },
342 { .name = "Australia/Perth", .timezoneString = "AWST-8" },
343 { .name = "Australia/Sydney", .timezoneString = "AEST-10AEDT,M10.1.0,M4.1.0/3" },
344 { .name = "Europe/Amsterdam", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
345 { .name = "Europe/Andorra", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
346 { .name = "Europe/Astrakhan", .timezoneString = "<+04>-4" },
347 { .name = "Europe/Athens", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
348 { .name = "Europe/Belgrade", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
349 { .name = "Europe/Berlin", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
350 { .name = "Europe/Bratislava", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
351 { .name = "Europe/Brussels", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
352 { .name = "Europe/Bucharest", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
353 { .name = "Europe/Budapest", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
354 { .name = "Europe/Busingen", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
355 { .name = "Europe/Chisinau", .timezoneString = "EET-2EEST,M3.5.0,M10.5.0/3" },
356 { .name = "Europe/Copenhagen", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
357 { .name = "Europe/Dublin", .timezoneString = "IST-1GMT0,M10.5.0,M3.5.0/1" },
358 { .name = "Europe/Gibraltar", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
359 { .name = "Europe/Guernsey", .timezoneString = "GMT0BST,M3.5.0/1,M10.5.0" },
360 { .name = "Europe/Helsinki", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
361 { .name = "Europe/Isle_of_Man", .timezoneString = "GMT0BST,M3.5.0/1,M10.5.0" },
362 { .name = "Europe/Istanbul", .timezoneString = "<+03>-3" },
363 { .name = "Europe/Jersey", .timezoneString = "GMT0BST,M3.5.0/1,M10.5.0" },
364 { .name = "Europe/Kaliningrad", .timezoneString = "EET-2" },
365 { .name = "Europe/Kiev", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
366 { .name = "Europe/Kirov", .timezoneString = "<+03>-3" },
367 { .name = "Europe/Lisbon", .timezoneString = "WET0WEST,M3.5.0/1,M10.5.0" },
368 { .name = "Europe/Ljubljana", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
369 { .name = "Europe/London", .timezoneString = "GMT0BST,M3.5.0/1,M10.5.0" },
370 { .name = "Europe/Luxembourg", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
371 { .name = "Europe/Madrid", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
372 { .name = "Europe/Malta", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
373 { .name = "Europe/Mariehamn", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
374 { .name = "Europe/Minsk", .timezoneString = "<+03>-3" },
375 { .name = "Europe/Monaco", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
376 { .name = "Europe/Moscow", .timezoneString = "MSK-3" },
377 { .name = "Europe/Oslo", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
378 { .name = "Europe/Paris", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
379 { .name = "Europe/Podgorica", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
380 { .name = "Europe/Prague", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
381 { .name = "Europe/Riga", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
382 { .name = "Europe/Rome", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
383 { .name = "Europe/Samara", .timezoneString = "<+04>-4" },
384 { .name = "Europe/San_Marino", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
385 { .name = "Europe/Sarajevo", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
386 { .name = "Europe/Saratov", .timezoneString = "<+04>-4" },
387 { .name = "Europe/Simferopol", .timezoneString = "MSK-3" },
388 { .name = "Europe/Skopje", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
389 { .name = "Europe/Sofia", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
390 { .name = "Europe/Stockholm", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
391 { .name = "Europe/Tallinn", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
392 { .name = "Europe/Tirane", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
393 { .name = "Europe/Ulyanovsk", .timezoneString = "<+04>-4" },
394 { .name = "Europe/Uzhgorod", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
395 { .name = "Europe/Vaduz", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
396 { .name = "Europe/Vatican", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
397 { .name = "Europe/Vienna", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
398 { .name = "Europe/Vilnius", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
399 { .name = "Europe/Volgograd", .timezoneString = "<+03>-3" },
400 { .name = "Europe/Warsaw", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
401 { .name = "Europe/Zagreb", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
402 { .name = "Europe/Zaporozhye", .timezoneString = "EET-2EEST,M3.5.0/3,M10.5.0/4" },
403 { .name = "Europe/Zurich", .timezoneString = "CET-1CEST,M3.5.0,M10.5.0/3" },
404 { .name = "Indian/Antananarivo", .timezoneString = "EAT-3" },
405 { .name = "Indian/Chagos", .timezoneString = "<+06>-6" },
406 { .name = "Indian/Christmas", .timezoneString = "<+07>-7" },
407 { .name = "Indian/Cocos", .timezoneString = "<+0630>-6:30" },
408 { .name = "Indian/Comoro", .timezoneString = "EAT-3" },
409 { .name = "Indian/Kerguelen", .timezoneString = "<+05>-5" },
410 { .name = "Indian/Mahe", .timezoneString = "<+04>-4" },
411 { .name = "Indian/Maldives", .timezoneString = "<+05>-5" },
412 { .name = "Indian/Mauritius", .timezoneString = "<+04>-4" },
413 { .name = "Indian/Mayotte", .timezoneString = "EAT-3" },
414 { .name = "Indian/Reunion", .timezoneString = "<+04>-4" },
415 { .name = "Pacific/Apia", .timezoneString = "<+13>-13" },
416 { .name = "Pacific/Auckland", .timezoneString = "NZST-12NZDT,M9.5.0,M4.1.0/3" },
417 { .name = "Pacific/Bougainville", .timezoneString = "<+11>-11" },
418 { .name = "Pacific/Chatham", .timezoneString = "<+1245>-12:45<+1345>,M9.5.0/2:45,M4.1.0/3:45" },
419 { .name = "Pacific/Chuuk", .timezoneString = "<+10>-10" },
420 { .name = "Pacific/Easter", .timezoneString = "<-06>6<-05>,M9.1.6/22,M4.1.6/22" },
421 { .name = "Pacific/Efate", .timezoneString = "<+11>-11" },
422 { .name = "Pacific/Enderbury", .timezoneString = "<+13>-13" },
423 { .name = "Pacific/Fakaofo", .timezoneString = "<+13>-13" },
424 { .name = "Pacific/Fiji", .timezoneString = "<+12>-12<+13>,M11.2.0,M1.2.3/99" },
425 { .name = "Pacific/Funafuti", .timezoneString = "<+12>-12" },
426 { .name = "Pacific/Galapagos", .timezoneString = "<-06>6" },
427 { .name = "Pacific/Gambier", .timezoneString = "<-09>9" },
428 { .name = "Pacific/Guadalcanal", .timezoneString = "<+11>-11" },
429 { .name = "Pacific/Guam", .timezoneString = "ChST-10" },
430 { .name = "Pacific/Honolulu", .timezoneString = "HST10" },
431 { .name = "Pacific/Kiritimati", .timezoneString = "<+14>-14" },
432 { .name = "Pacific/Kosrae", .timezoneString = "<+11>-11" },
433 { .name = "Pacific/Kwajalein", .timezoneString = "<+12>-12" },
434 { .name = "Pacific/Majuro", .timezoneString = "<+12>-12" },
435 { .name = "Pacific/Marquesas", .timezoneString = "<-0930>9:30" },
436 { .name = "Pacific/Midway", .timezoneString = "SST11" },
437 { .name = "Pacific/Nauru", .timezoneString = "<+12>-12" },
438 { .name = "Pacific/Niue", .timezoneString = "<-11>11" },
439 { .name = "Pacific/Norfolk", .timezoneString = "<+11>-11<+12>,M10.1.0,M4.1.0/3" },
440 { .name = "Pacific/Noumea", .timezoneString = "<+11>-11" },
441 { .name = "Pacific/Pago_Pago", .timezoneString = "SST11" },
442 { .name = "Pacific/Palau", .timezoneString = "<+09>-9" },
443 { .name = "Pacific/Pitcairn", .timezoneString = "<-08>8" },
444 { .name = "Pacific/Pohnpei", .timezoneString = "<+11>-11" },
445 { .name = "Pacific/Port_Moresby", .timezoneString = "<+10>-10" },
446 { .name = "Pacific/Rarotonga", .timezoneString = "<-10>10" },
447 { .name = "Pacific/Saipan", .timezoneString = "ChST-10" },
448 { .name = "Pacific/Tahiti", .timezoneString = "<-10>10" },
449 { .name = "Pacific/Tarawa", .timezoneString = "<+12>-12" },
450 { .name = "Pacific/Tongatapu", .timezoneString = "<+13>-13" },
451 { .name = "Pacific/Wake", .timezoneString = "<+12>-12" },
452 { .name = "Pacific/Wallis", .timezoneString = "<+12>-12" },
453 { .name = "Etc/GMT", .timezoneString = "GMT0" },
454 { .name = "Etc/GMT-0", .timezoneString = "GMT0" },
455 { .name = "Etc/GMT-1", .timezoneString = "<+01>-1" },
456 { .name = "Etc/GMT-2", .timezoneString = "<+02>-2" },
457 { .name = "Etc/GMT-3", .timezoneString = "<+03>-3" },
458 { .name = "Etc/GMT-4", .timezoneString = "<+04>-4" },
459 { .name = "Etc/GMT-5", .timezoneString = "<+05>-5" },
460 { .name = "Etc/GMT-6", .timezoneString = "<+06>-6" },
461 { .name = "Etc/GMT-7", .timezoneString = "<+07>-7" },
462 { .name = "Etc/GMT-8", .timezoneString = "<+08>-8" },
463 { .name = "Etc/GMT-9", .timezoneString = "<+09>-9" },
464 { .name = "Etc/GMT-10", .timezoneString = "<+10>-10" },
465 { .name = "Etc/GMT-11", .timezoneString = "<+11>-11" },
466 { .name = "Etc/GMT-12", .timezoneString = "<+12>-12" },
467 { .name = "Etc/GMT-13", .timezoneString = "<+13>-13" },
468 { .name = "Etc/GMT-14", .timezoneString = "<+14>-14" },
469 { .name = "Etc/GMT0", .timezoneString = "GMT0" },
470 { .name = "Etc/GMT+0", .timezoneString = "GMT0" },
471 { .name = "Etc/GMT+1", .timezoneString = "<-01>1" },
472 { .name = "Etc/GMT+2", .timezoneString = "<-02>2" },
473 { .name = "Etc/GMT+3", .timezoneString = "<-03>3" },
474 { .name = "Etc/GMT+4", .timezoneString = "<-04>4" },
475 { .name = "Etc/GMT+5", .timezoneString = "<-05>5" },
476 { .name = "Etc/GMT+6", .timezoneString = "<-06>6" },
477 { .name = "Etc/GMT+7", .timezoneString = "<-07>7" },
478 { .name = "Etc/GMT+8", .timezoneString = "<-08>8" },
479 { .name = "Etc/GMT+9", .timezoneString = "<-09>9" },
480 { .name = "Etc/GMT+10", .timezoneString = "<-10>10" },
481 { .name = "Etc/GMT+11", .timezoneString = "<-11>11" },
482 { .name = "Etc/GMT+12", .timezoneString = "<-12>12" },
483 { .name = "Etc/UCT", .timezoneString = "UTC0" },
484 { .name = "Etc/UTC", .timezoneString = "UTC0" },
485 { .name = "Etc/Greenwich", .timezoneString = "GMT0" },
486 { .name = "Etc/Universal", .timezoneString = "UTC0" },
487 { .name = "Etc/Zulu", .timezoneString = "UTC0" }
488
489 };
500 virtual TIMEERROR setTimezone(const pocuterTimezone* tz, bool save = true) = 0;
501
502
512 virtual TIMEERROR getLocalTime(tm* time) = 0;
513
523 virtual TIMEERROR getGMTTime(tm* time) = 0;
524
534 virtual TIMEERROR setLocalTime(tm* time) = 0;
535
542 virtual const char* getCurrentTimezone() = 0;
543
553 virtual TIMEERROR setTimeServer(const char* timeServer) = 0;
554
564 virtual TIMEERROR setTimeServer(bool on) = 0;
565
566
575 virtual bool isTimeServer() = 0;
576
586 virtual const char* getTimeServer() = 0;
587
599 TIMEERROR getAllTimezones(const pocuterTimezone** tz, uint16_t* count) {
600 *tz = c_tz;
601 *count = TIME_ZONES_COUNT;
602 return TIMEERROR_OK;
603 }
604
605
606
607 private:
608
609 };
610
611
612
613 #endif /* POCUTERTIME_H */
614 #endif
615
PocuterTime::TIMEERROR_UNKNOWN
@ TIMEERROR_UNKNOWN
Definition: PocuterTime.h:17
PocuterTime
access the Pocuter real time clock
Definition: PocuterTime.h:10
TIME_ZONES_COUNT
#define TIME_ZONES_COUNT
Definition: PocuterTime.h:25
PocuterTime::setLocalTime
virtual TIMEERROR setLocalTime(tm *time)=0
set the local time
PocuterTime::getAllTimezones
TIMEERROR getAllTimezones(const pocuterTimezone **tz, uint16_t *count)
get all available timezones
Definition: PocuterTime.h:599
PocuterTime::pocuterTimezone::name
const char * name
Definition: PocuterTime.h:22
PocuterTime::getTimeServer
virtual const char * getTimeServer()=0
get the current time server address
PocuterTime::setTimeServer
virtual TIMEERROR setTimeServer(const char *timeServer)=0
set the address of the time server
PocuterTime::getLocalTime
virtual TIMEERROR getLocalTime(tm *time)=0
get the local time as tm struct.
PocuterTime::TIMEERROR
TIMEERROR
Definition: PocuterTime.h:12
PocuterTime::getGMTTime
virtual TIMEERROR getGMTTime(tm *time)=0
get the gmt time as tm struct.
PocuterTime::c_tz
const pocuterTimezone c_tz[TIME_ZONES_COUNT]
Definition: PocuterTime.h:26
PocuterTime::TIMEERROR_OK
@ TIMEERROR_OK
Definition: PocuterTime.h:13
PocuterTime::isTimeServer
virtual bool isTimeServer()=0
request if a timeserver connection was activated
PocuterTime::TIMEERROR_FAILED
@ TIMEERROR_FAILED
Definition: PocuterTime.h:14
PocuterTime::pocuterTimezone
Definition: PocuterTime.h:21
PocuterTime::pocuterTimezone::timezoneString
const char * timezoneString
Definition: PocuterTime.h:23
PocuterTime::getCurrentTimezone
virtual const char * getCurrentTimezone()=0
get the current time zone
PocuterTime::setTimezone
virtual TIMEERROR setTimezone(const pocuterTimezone *tz, bool save=true)=0
changes the time zone