1 package de_CH
2
3 import (
4 "math"
5 "strconv"
6 "time"
7
8 "github.com/go-playground/locales"
9 "github.com/go-playground/locales/currency"
10 )
11
12 type de_CH struct {
13 locale string
14 pluralsCardinal []locales.PluralRule
15 pluralsOrdinal []locales.PluralRule
16 pluralsRange []locales.PluralRule
17 decimal string
18 group string
19 minus string
20 percent string
21 perMille string
22 timeSeparator string
23 inifinity string
24 currencies []string
25 currencyPositivePrefix string
26 currencyNegativePrefix string
27 monthsAbbreviated []string
28 monthsNarrow []string
29 monthsWide []string
30 daysAbbreviated []string
31 daysNarrow []string
32 daysShort []string
33 daysWide []string
34 periodsAbbreviated []string
35 periodsNarrow []string
36 periodsShort []string
37 periodsWide []string
38 erasAbbreviated []string
39 erasNarrow []string
40 erasWide []string
41 timezones map[string]string
42 }
43
44
45 func New() locales.Translator {
46 return &de_CH{
47 locale: "de_CH",
48 pluralsCardinal: []locales.PluralRule{2, 6},
49 pluralsOrdinal: []locales.PluralRule{6},
50 pluralsRange: []locales.PluralRule{2, 6},
51 decimal: ".",
52 group: "’",
53 minus: "-",
54 percent: "%",
55 perMille: "‰",
56 timeSeparator: ":",
57 inifinity: "∞",
58 currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MRU", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UYW", "UZS", "VEB", "VEF", "VES", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
59 currencyPositivePrefix: " ",
60 currencyNegativePrefix: " ",
61 monthsAbbreviated: []string{"", "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sept.", "Okt.", "Nov.", "Dez."},
62 monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
63 monthsWide: []string{"", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
64 daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
65 daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
66 daysShort: []string{"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"},
67 daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
68 periodsAbbreviated: []string{"AM", "PM"},
69 periodsNarrow: []string{"", ""},
70 periodsWide: []string{"AM", "PM"},
71 erasAbbreviated: []string{"v. Chr.", "n. Chr."},
72 erasNarrow: []string{"v. Chr.", "n. Chr."},
73 erasWide: []string{"v. Chr.", "n. Chr."},
74 timezones: map[string]string{"ACDT": "Zentralaustralische Sommerzeit", "ACST": "Zentralaustralische Normalzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "ADT": "Atlantik-Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "AEST": "Ostaustralische Normalzeit", "AKDT": "Alaska-Sommerzeit", "AKST": "Alaska-Normalzeit", "ARST": "Argentinische Sommerzeit", "ART": "Argentinische Normalzeit", "AST": "Atlantik-Normalzeit", "AWDT": "Westaustralische Sommerzeit", "AWST": "Westaustralische Normalzeit", "BOT": "Bolivianische Zeit", "BT": "Bhutan-Zeit", "CAT": "Zentralafrikanische Zeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "CHADT": "Chatham-Sommerzeit", "CHAST": "Chatham-Normalzeit", "CLST": "Chilenische Sommerzeit", "CLT": "Chilenische Normalzeit", "COST": "Kolumbianische Sommerzeit", "COT": "Kolumbianische Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "ChST": "Chamorro-Zeit", "EAT": "Ostafrikanische Zeit", "ECT": "Ecuadorianische Zeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "GFT": "Französisch-Guayana-Zeit", "GMT": "Mittlere Greenwich-Zeit", "GST": "Golf-Zeit", "GYT": "Guyana-Zeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "HAT": "Neufundland-Sommerzeit", "HECU": "Kubanische Sommerzeit", "HEEG": "Ostgrönland-Sommerzeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "HEOG": "Westgrönland-Sommerzeit", "HEPM": "St.-Pierre-und-Miquelon-Sommerzeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "HKST": "Hongkong-Sommerzeit", "HKT": "Hongkong-Normalzeit", "HNCU": "Kubanische Normalzeit", "HNEG": "Ostgrönland-Normalzeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "HNOG": "Westgrönland-Normalzeit", "HNPM": "St.-Pierre-und-Miquelon-Normalzeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "HNT": "Neufundland-Normalzeit", "IST": "Indische Zeit", "JDT": "Japanische Sommerzeit", "JST": "Japanische Normalzeit", "LHDT": "Lord-Howe-Sommerzeit", "LHST": "Lord-Howe-Normalzeit", "MDT": "Rocky-Mountain-Sommerzeit", "MESZ": "Mitteleuropäische Sommerzeit", "MEZ": "Mitteleuropäische Normalzeit", "MST": "Rocky Mountain-Normalzeit", "MYT": "Malaysische Zeit", "NZDT": "Neuseeland-Sommerzeit", "NZST": "Neuseeland-Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "OEZ": "Osteuropäische Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "SAST": "Südafrikanische Zeit", "SGT": "Singapur-Zeit", "SRT": "Suriname-Zeit", "TMST": "Turkmenistan-Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "UYST": "Uruguayanische Sommerzeit", "UYT": "Uruguyanische Normalzeit", "VET": "Venezuela-Zeit", "WARST": "Westargentinische Sommerzeit", "WART": "Westargentinische Normalzeit", "WAST": "Westafrikanische Sommerzeit", "WAT": "Westafrikanische Normalzeit", "WESZ": "Westeuropäische Sommerzeit", "WEZ": "Westeuropäische Normalzeit", "WIB": "Westindonesische Zeit", "WIT": "Ostindonesische Zeit", "WITA": "Zentralindonesische Zeit", "∅∅∅": "Azoren-Sommerzeit"},
75 }
76 }
77
78
79 func (de *de_CH) Locale() string {
80 return de.locale
81 }
82
83
84 func (de *de_CH) PluralsCardinal() []locales.PluralRule {
85 return de.pluralsCardinal
86 }
87
88
89 func (de *de_CH) PluralsOrdinal() []locales.PluralRule {
90 return de.pluralsOrdinal
91 }
92
93
94 func (de *de_CH) PluralsRange() []locales.PluralRule {
95 return de.pluralsRange
96 }
97
98
99 func (de *de_CH) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101 n := math.Abs(num)
102 i := int64(n)
103
104 if i == 1 && v == 0 {
105 return locales.PluralRuleOne
106 }
107
108 return locales.PluralRuleOther
109 }
110
111
112 func (de *de_CH) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
113 return locales.PluralRuleOther
114 }
115
116
117 func (de *de_CH) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
118
119 start := de.CardinalPluralRule(num1, v1)
120 end := de.CardinalPluralRule(num2, v2)
121
122 if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
123 return locales.PluralRuleOther
124 } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
125 return locales.PluralRuleOne
126 }
127
128 return locales.PluralRuleOther
129
130 }
131
132
133 func (de *de_CH) MonthAbbreviated(month time.Month) string {
134 return de.monthsAbbreviated[month]
135 }
136
137
138 func (de *de_CH) MonthsAbbreviated() []string {
139 return de.monthsAbbreviated[1:]
140 }
141
142
143 func (de *de_CH) MonthNarrow(month time.Month) string {
144 return de.monthsNarrow[month]
145 }
146
147
148 func (de *de_CH) MonthsNarrow() []string {
149 return de.monthsNarrow[1:]
150 }
151
152
153 func (de *de_CH) MonthWide(month time.Month) string {
154 return de.monthsWide[month]
155 }
156
157
158 func (de *de_CH) MonthsWide() []string {
159 return de.monthsWide[1:]
160 }
161
162
163 func (de *de_CH) WeekdayAbbreviated(weekday time.Weekday) string {
164 return de.daysAbbreviated[weekday]
165 }
166
167
168 func (de *de_CH) WeekdaysAbbreviated() []string {
169 return de.daysAbbreviated
170 }
171
172
173 func (de *de_CH) WeekdayNarrow(weekday time.Weekday) string {
174 return de.daysNarrow[weekday]
175 }
176
177
178 func (de *de_CH) WeekdaysNarrow() []string {
179 return de.daysNarrow
180 }
181
182
183 func (de *de_CH) WeekdayShort(weekday time.Weekday) string {
184 return de.daysShort[weekday]
185 }
186
187
188 func (de *de_CH) WeekdaysShort() []string {
189 return de.daysShort
190 }
191
192
193 func (de *de_CH) WeekdayWide(weekday time.Weekday) string {
194 return de.daysWide[weekday]
195 }
196
197
198 func (de *de_CH) WeekdaysWide() []string {
199 return de.daysWide
200 }
201
202
203 func (de *de_CH) Decimal() string {
204 return de.decimal
205 }
206
207
208 func (de *de_CH) Group() string {
209 return de.group
210 }
211
212
213 func (de *de_CH) Minus() string {
214 return de.minus
215 }
216
217
218 func (de *de_CH) FmtNumber(num float64, v uint64) string {
219
220 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
221 l := len(s) + 2 + 3*len(s[:len(s)-int(v)-1])/3
222 count := 0
223 inWhole := v == 0
224 b := make([]byte, 0, l)
225
226 for i := len(s) - 1; i >= 0; i-- {
227
228 if s[i] == '.' {
229 b = append(b, de.decimal[0])
230 inWhole = true
231 continue
232 }
233
234 if inWhole {
235 if count == 3 {
236 for j := len(de.group) - 1; j >= 0; j-- {
237 b = append(b, de.group[j])
238 }
239 count = 1
240 } else {
241 count++
242 }
243 }
244
245 b = append(b, s[i])
246 }
247
248 if num < 0 {
249 b = append(b, de.minus[0])
250 }
251
252
253 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
254 b[i], b[j] = b[j], b[i]
255 }
256
257 return string(b)
258 }
259
260
261
262 func (de *de_CH) FmtPercent(num float64, v uint64) string {
263 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
264 l := len(s) + 3
265 b := make([]byte, 0, l)
266
267 for i := len(s) - 1; i >= 0; i-- {
268
269 if s[i] == '.' {
270 b = append(b, de.decimal[0])
271 continue
272 }
273
274 b = append(b, s[i])
275 }
276
277 if num < 0 {
278 b = append(b, de.minus[0])
279 }
280
281
282 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
283 b[i], b[j] = b[j], b[i]
284 }
285
286 b = append(b, de.percent...)
287
288 return string(b)
289 }
290
291
292 func (de *de_CH) FmtCurrency(num float64, v uint64, currency currency.Type) string {
293
294 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
295 symbol := de.currencies[currency]
296 l := len(s) + len(symbol) + 4 + 3*len(s[:len(s)-int(v)-1])/3
297 count := 0
298 inWhole := v == 0
299 b := make([]byte, 0, l)
300
301 for i := len(s) - 1; i >= 0; i-- {
302
303 if s[i] == '.' {
304 b = append(b, de.decimal[0])
305 inWhole = true
306 continue
307 }
308
309 if inWhole {
310 if count == 3 {
311 for j := len(de.group) - 1; j >= 0; j-- {
312 b = append(b, de.group[j])
313 }
314 count = 1
315 } else {
316 count++
317 }
318 }
319
320 b = append(b, s[i])
321 }
322
323 for j := len(symbol) - 1; j >= 0; j-- {
324 b = append(b, symbol[j])
325 }
326
327 for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
328 b = append(b, de.currencyPositivePrefix[j])
329 }
330
331 if num < 0 {
332 b = append(b, de.minus[0])
333 }
334
335
336 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
337 b[i], b[j] = b[j], b[i]
338 }
339
340 if int(v) < 2 {
341
342 if v == 0 {
343 b = append(b, de.decimal...)
344 }
345
346 for i := 0; i < 2-int(v); i++ {
347 b = append(b, '0')
348 }
349 }
350
351 return string(b)
352 }
353
354
355
356 func (de *de_CH) FmtAccounting(num float64, v uint64, currency currency.Type) string {
357
358 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
359 symbol := de.currencies[currency]
360 l := len(s) + len(symbol) + 4 + 3*len(s[:len(s)-int(v)-1])/3
361 count := 0
362 inWhole := v == 0
363 b := make([]byte, 0, l)
364
365 for i := len(s) - 1; i >= 0; i-- {
366
367 if s[i] == '.' {
368 b = append(b, de.decimal[0])
369 inWhole = true
370 continue
371 }
372
373 if inWhole {
374 if count == 3 {
375 for j := len(de.group) - 1; j >= 0; j-- {
376 b = append(b, de.group[j])
377 }
378 count = 1
379 } else {
380 count++
381 }
382 }
383
384 b = append(b, s[i])
385 }
386
387 if num < 0 {
388
389 for j := len(symbol) - 1; j >= 0; j-- {
390 b = append(b, symbol[j])
391 }
392
393 for j := len(de.currencyNegativePrefix) - 1; j >= 0; j-- {
394 b = append(b, de.currencyNegativePrefix[j])
395 }
396
397 b = append(b, de.minus[0])
398
399 } else {
400
401 for j := len(symbol) - 1; j >= 0; j-- {
402 b = append(b, symbol[j])
403 }
404
405 for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
406 b = append(b, de.currencyPositivePrefix[j])
407 }
408
409 }
410
411
412 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
413 b[i], b[j] = b[j], b[i]
414 }
415
416 if int(v) < 2 {
417
418 if v == 0 {
419 b = append(b, de.decimal...)
420 }
421
422 for i := 0; i < 2-int(v); i++ {
423 b = append(b, '0')
424 }
425 }
426
427 return string(b)
428 }
429
430
431 func (de *de_CH) FmtDateShort(t time.Time) string {
432
433 b := make([]byte, 0, 32)
434
435 if t.Day() < 10 {
436 b = append(b, '0')
437 }
438
439 b = strconv.AppendInt(b, int64(t.Day()), 10)
440 b = append(b, []byte{0x2e}...)
441
442 if t.Month() < 10 {
443 b = append(b, '0')
444 }
445
446 b = strconv.AppendInt(b, int64(t.Month()), 10)
447
448 b = append(b, []byte{0x2e}...)
449
450 if t.Year() > 9 {
451 b = append(b, strconv.Itoa(t.Year())[2:]...)
452 } else {
453 b = append(b, strconv.Itoa(t.Year())[1:]...)
454 }
455
456 return string(b)
457 }
458
459
460 func (de *de_CH) FmtDateMedium(t time.Time) string {
461
462 b := make([]byte, 0, 32)
463
464 if t.Day() < 10 {
465 b = append(b, '0')
466 }
467
468 b = strconv.AppendInt(b, int64(t.Day()), 10)
469 b = append(b, []byte{0x2e}...)
470
471 if t.Month() < 10 {
472 b = append(b, '0')
473 }
474
475 b = strconv.AppendInt(b, int64(t.Month()), 10)
476
477 b = append(b, []byte{0x2e}...)
478
479 if t.Year() > 0 {
480 b = strconv.AppendInt(b, int64(t.Year()), 10)
481 } else {
482 b = strconv.AppendInt(b, int64(-t.Year()), 10)
483 }
484
485 return string(b)
486 }
487
488
489 func (de *de_CH) FmtDateLong(t time.Time) string {
490
491 b := make([]byte, 0, 32)
492
493 b = strconv.AppendInt(b, int64(t.Day()), 10)
494 b = append(b, []byte{0x2e, 0x20}...)
495 b = append(b, de.monthsWide[t.Month()]...)
496 b = append(b, []byte{0x20}...)
497
498 if t.Year() > 0 {
499 b = strconv.AppendInt(b, int64(t.Year()), 10)
500 } else {
501 b = strconv.AppendInt(b, int64(-t.Year()), 10)
502 }
503
504 return string(b)
505 }
506
507
508 func (de *de_CH) FmtDateFull(t time.Time) string {
509
510 b := make([]byte, 0, 32)
511
512 b = append(b, de.daysWide[t.Weekday()]...)
513 b = append(b, []byte{0x2c, 0x20}...)
514 b = strconv.AppendInt(b, int64(t.Day()), 10)
515 b = append(b, []byte{0x2e, 0x20}...)
516 b = append(b, de.monthsWide[t.Month()]...)
517 b = append(b, []byte{0x20}...)
518
519 if t.Year() > 0 {
520 b = strconv.AppendInt(b, int64(t.Year()), 10)
521 } else {
522 b = strconv.AppendInt(b, int64(-t.Year()), 10)
523 }
524
525 return string(b)
526 }
527
528
529 func (de *de_CH) FmtTimeShort(t time.Time) string {
530
531 b := make([]byte, 0, 32)
532
533 if t.Hour() < 10 {
534 b = append(b, '0')
535 }
536
537 b = strconv.AppendInt(b, int64(t.Hour()), 10)
538 b = append(b, de.timeSeparator...)
539
540 if t.Minute() < 10 {
541 b = append(b, '0')
542 }
543
544 b = strconv.AppendInt(b, int64(t.Minute()), 10)
545
546 return string(b)
547 }
548
549
550 func (de *de_CH) FmtTimeMedium(t time.Time) string {
551
552 b := make([]byte, 0, 32)
553
554 if t.Hour() < 10 {
555 b = append(b, '0')
556 }
557
558 b = strconv.AppendInt(b, int64(t.Hour()), 10)
559 b = append(b, de.timeSeparator...)
560
561 if t.Minute() < 10 {
562 b = append(b, '0')
563 }
564
565 b = strconv.AppendInt(b, int64(t.Minute()), 10)
566 b = append(b, de.timeSeparator...)
567
568 if t.Second() < 10 {
569 b = append(b, '0')
570 }
571
572 b = strconv.AppendInt(b, int64(t.Second()), 10)
573
574 return string(b)
575 }
576
577
578 func (de *de_CH) FmtTimeLong(t time.Time) string {
579
580 b := make([]byte, 0, 32)
581
582 if t.Hour() < 10 {
583 b = append(b, '0')
584 }
585
586 b = strconv.AppendInt(b, int64(t.Hour()), 10)
587 b = append(b, de.timeSeparator...)
588
589 if t.Minute() < 10 {
590 b = append(b, '0')
591 }
592
593 b = strconv.AppendInt(b, int64(t.Minute()), 10)
594 b = append(b, de.timeSeparator...)
595
596 if t.Second() < 10 {
597 b = append(b, '0')
598 }
599
600 b = strconv.AppendInt(b, int64(t.Second()), 10)
601 b = append(b, []byte{0x20}...)
602
603 tz, _ := t.Zone()
604 b = append(b, tz...)
605
606 return string(b)
607 }
608
609
610 func (de *de_CH) FmtTimeFull(t time.Time) string {
611
612 b := make([]byte, 0, 32)
613
614 if t.Hour() < 10 {
615 b = append(b, '0')
616 }
617
618 b = strconv.AppendInt(b, int64(t.Hour()), 10)
619 b = append(b, de.timeSeparator...)
620
621 if t.Minute() < 10 {
622 b = append(b, '0')
623 }
624
625 b = strconv.AppendInt(b, int64(t.Minute()), 10)
626 b = append(b, de.timeSeparator...)
627
628 if t.Second() < 10 {
629 b = append(b, '0')
630 }
631
632 b = strconv.AppendInt(b, int64(t.Second()), 10)
633 b = append(b, []byte{0x20}...)
634
635 tz, _ := t.Zone()
636
637 if btz, ok := de.timezones[tz]; ok {
638 b = append(b, btz...)
639 } else {
640 b = append(b, tz...)
641 }
642
643 return string(b)
644 }
645
View as plain text