1 package es_CO
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 es_CO 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 percentSuffix string
22 perMille string
23 timeSeparator string
24 inifinity string
25 currencies []string
26 currencyPositivePrefix string
27 currencyNegativePrefix string
28 monthsAbbreviated []string
29 monthsNarrow []string
30 monthsWide []string
31 daysAbbreviated []string
32 daysNarrow []string
33 daysShort []string
34 daysWide []string
35 periodsAbbreviated []string
36 periodsNarrow []string
37 periodsShort []string
38 periodsWide []string
39 erasAbbreviated []string
40 erasNarrow []string
41 erasWide []string
42 timezones map[string]string
43 }
44
45
46 func New() locales.Translator {
47 return &es_CO{
48 locale: "es_CO",
49 pluralsCardinal: []locales.PluralRule{2, 6},
50 pluralsOrdinal: []locales.PluralRule{6},
51 pluralsRange: []locales.PluralRule{6},
52 decimal: ",",
53 group: ".",
54 minus: "-",
55 percent: "%",
56 perMille: "‰",
57 timeSeparator: ":",
58 inifinity: "∞",
59 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", "$", "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", "US$", "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"},
60 percentSuffix: " ",
61 currencyPositivePrefix: " ",
62 currencyNegativePrefix: " ",
63 monthsAbbreviated: []string{"", "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sept.", "oct.", "nov.", "dic."},
64 monthsNarrow: []string{"", "E", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
65 monthsWide: []string{"", "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"},
66 daysAbbreviated: []string{"dom.", "lun.", "mar.", "mié.", "jue.", "vie.", "sáb."},
67 daysNarrow: []string{"D", "L", "M", "M", "J", "V", "S"},
68 daysShort: []string{"DO", "LU", "MA", "MI", "JU", "VI", "SA"},
69 daysWide: []string{"domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"},
70 periodsAbbreviated: []string{"a.\u00a0m.", "p.\u00a0m."},
71 periodsNarrow: []string{"", ""},
72 periodsWide: []string{"a.\u00a0m.", "p.\u00a0m."},
73 erasAbbreviated: []string{"a. C.", "d. C."},
74 erasNarrow: []string{"", ""},
75 erasWide: []string{"antes de Cristo", "después de Cristo"},
76 timezones: map[string]string{"ACDT": "hora de verano de Australia central", "ACST": "hora estándar de Australia central", "ACWDT": "hora de verano de Australia centroccidental", "ACWST": "hora estándar de Australia centroccidental", "ADT": "hora de verano del Atlántico", "AEDT": "hora de verano de Australia oriental", "AEST": "hora estándar de Australia oriental", "AKDT": "hora de verano de Alaska", "AKST": "hora estándar de Alaska", "ARST": "hora de verano de Argentina", "ART": "hora estándar de Argentina", "AST": "hora estándar del Atlántico", "AWDT": "hora de verano de Australia occidental", "AWST": "hora estándar de Australia occidental", "BOT": "hora de Bolivia", "BT": "hora de Bután", "CAT": "hora de África central", "CDT": "hora de verano central", "CHADT": "hora de verano de Chatham", "CHAST": "hora estándar de Chatham", "CLST": "hora de verano de Chile", "CLT": "hora estándar de Chile", "COST": "hora de verano de Colombia", "COT": "hora estándar de Colombia", "CST": "hora estándar central", "ChST": "hora estándar de Chamorro", "EAT": "hora de África oriental", "ECT": "hora de Ecuador", "EDT": "hora de verano oriental", "EST": "hora estándar oriental", "GFT": "hora de la Guayana Francesa", "GMT": "hora del meridiano de Greenwich", "GST": "hora estándar del Golfo", "GYT": "hora de Guyana", "HADT": "hora de verano de Hawái-Aleutianas", "HAST": "hora estándar de Hawái-Aleutianas", "HAT": "hora de verano de Terranova", "HECU": "hora de verano de Cuba", "HEEG": "hora de verano de Groenlandia oriental", "HENOMX": "hora de verano del noroeste de México", "HEOG": "hora de verano de Groenlandia occidental", "HEPM": "hora de verano de San Pedro y Miquelón", "HEPMX": "hora de verano del Pacífico de México", "HKST": "hora de verano de Hong Kong", "HKT": "hora estándar de Hong Kong", "HNCU": "hora estándar de Cuba", "HNEG": "hora estándar de Groenlandia oriental", "HNNOMX": "hora estándar del noroeste de México", "HNOG": "hora estándar de Groenlandia occidental", "HNPM": "hora estándar de San Pedro y Miquelón", "HNPMX": "hora estándar del Pacífico de México", "HNT": "hora estándar de Terranova", "IST": "hora de India", "JDT": "hora de verano de Japón", "JST": "hora estándar de Japón", "LHDT": "hora de verano de Lord Howe", "LHST": "hora estándar de Lord Howe", "MDT": "hora de verano de la montaña", "MESZ": "hora de verano de Europa central", "MEZ": "hora estándar de Europa central", "MST": "hora estándar de la montaña", "MYT": "hora de Malasia", "NZDT": "hora de verano de Nueva Zelanda", "NZST": "hora estándar de Nueva Zelanda", "OESZ": "hora de verano de Europa del Este", "OEZ": "hora estándar de Europa del Este", "PDT": "hora de verano del Pacífico", "PST": "hora estándar del Pacífico", "SAST": "hora de Sudáfrica", "SGT": "hora de Singapur", "SRT": "hora de Surinam", "TMST": "hora de verano de Turkmenistán", "TMT": "hora estándar de Turkmenistán", "UYST": "hora de verano de Uruguay", "UYT": "hora estándar de Uruguay", "VET": "hora de Venezuela", "WARST": "hora de verano de Argentina occidental", "WART": "hora estándar de Argentina occidental", "WAST": "hora de verano de África occidental", "WAT": "hora estándar de África occidental", "WESZ": "hora de verano de Europa del Oeste", "WEZ": "hora estándar de Europa del Oeste", "WIB": "hora de Indonesia occidental", "WIT": "hora de Indonesia oriental", "WITA": "hora de Indonesia central", "∅∅∅": "hora de verano de Perú"},
77 }
78 }
79
80
81 func (es *es_CO) Locale() string {
82 return es.locale
83 }
84
85
86 func (es *es_CO) PluralsCardinal() []locales.PluralRule {
87 return es.pluralsCardinal
88 }
89
90
91 func (es *es_CO) PluralsOrdinal() []locales.PluralRule {
92 return es.pluralsOrdinal
93 }
94
95
96 func (es *es_CO) PluralsRange() []locales.PluralRule {
97 return es.pluralsRange
98 }
99
100
101 func (es *es_CO) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
102
103 n := math.Abs(num)
104
105 if n == 1 {
106 return locales.PluralRuleOne
107 }
108
109 return locales.PluralRuleOther
110 }
111
112
113 func (es *es_CO) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
114 return locales.PluralRuleOther
115 }
116
117
118 func (es *es_CO) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
119 return locales.PluralRuleOther
120 }
121
122
123 func (es *es_CO) MonthAbbreviated(month time.Month) string {
124 return es.monthsAbbreviated[month]
125 }
126
127
128 func (es *es_CO) MonthsAbbreviated() []string {
129 return es.monthsAbbreviated[1:]
130 }
131
132
133 func (es *es_CO) MonthNarrow(month time.Month) string {
134 return es.monthsNarrow[month]
135 }
136
137
138 func (es *es_CO) MonthsNarrow() []string {
139 return es.monthsNarrow[1:]
140 }
141
142
143 func (es *es_CO) MonthWide(month time.Month) string {
144 return es.monthsWide[month]
145 }
146
147
148 func (es *es_CO) MonthsWide() []string {
149 return es.monthsWide[1:]
150 }
151
152
153 func (es *es_CO) WeekdayAbbreviated(weekday time.Weekday) string {
154 return es.daysAbbreviated[weekday]
155 }
156
157
158 func (es *es_CO) WeekdaysAbbreviated() []string {
159 return es.daysAbbreviated
160 }
161
162
163 func (es *es_CO) WeekdayNarrow(weekday time.Weekday) string {
164 return es.daysNarrow[weekday]
165 }
166
167
168 func (es *es_CO) WeekdaysNarrow() []string {
169 return es.daysNarrow
170 }
171
172
173 func (es *es_CO) WeekdayShort(weekday time.Weekday) string {
174 return es.daysShort[weekday]
175 }
176
177
178 func (es *es_CO) WeekdaysShort() []string {
179 return es.daysShort
180 }
181
182
183 func (es *es_CO) WeekdayWide(weekday time.Weekday) string {
184 return es.daysWide[weekday]
185 }
186
187
188 func (es *es_CO) WeekdaysWide() []string {
189 return es.daysWide
190 }
191
192
193 func (es *es_CO) Decimal() string {
194 return es.decimal
195 }
196
197
198 func (es *es_CO) Group() string {
199 return es.group
200 }
201
202
203 func (es *es_CO) Minus() string {
204 return es.minus
205 }
206
207
208 func (es *es_CO) FmtNumber(num float64, v uint64) string {
209
210 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
211 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
212 count := 0
213 inWhole := v == 0
214 b := make([]byte, 0, l)
215
216 for i := len(s) - 1; i >= 0; i-- {
217
218 if s[i] == '.' {
219 b = append(b, es.decimal[0])
220 inWhole = true
221 continue
222 }
223
224 if inWhole {
225 if count == 3 {
226 b = append(b, es.group[0])
227 count = 1
228 } else {
229 count++
230 }
231 }
232
233 b = append(b, s[i])
234 }
235
236 if num < 0 {
237 b = append(b, es.minus[0])
238 }
239
240
241 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
242 b[i], b[j] = b[j], b[i]
243 }
244
245 return string(b)
246 }
247
248
249
250 func (es *es_CO) FmtPercent(num float64, v uint64) string {
251 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
252 l := len(s) + 5
253 b := make([]byte, 0, l)
254
255 for i := len(s) - 1; i >= 0; i-- {
256
257 if s[i] == '.' {
258 b = append(b, es.decimal[0])
259 continue
260 }
261
262 b = append(b, s[i])
263 }
264
265 if num < 0 {
266 b = append(b, es.minus[0])
267 }
268
269
270 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
271 b[i], b[j] = b[j], b[i]
272 }
273
274 b = append(b, es.percentSuffix...)
275
276 b = append(b, es.percent...)
277
278 return string(b)
279 }
280
281
282 func (es *es_CO) FmtCurrency(num float64, v uint64, currency currency.Type) string {
283
284 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
285 symbol := es.currencies[currency]
286 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
287 count := 0
288 inWhole := v == 0
289 b := make([]byte, 0, l)
290
291 for i := len(s) - 1; i >= 0; i-- {
292
293 if s[i] == '.' {
294 b = append(b, es.decimal[0])
295 inWhole = true
296 continue
297 }
298
299 if inWhole {
300 if count == 3 {
301 b = append(b, es.group[0])
302 count = 1
303 } else {
304 count++
305 }
306 }
307
308 b = append(b, s[i])
309 }
310
311 for j := len(symbol) - 1; j >= 0; j-- {
312 b = append(b, symbol[j])
313 }
314
315 for j := len(es.currencyPositivePrefix) - 1; j >= 0; j-- {
316 b = append(b, es.currencyPositivePrefix[j])
317 }
318
319 if num < 0 {
320 b = append(b, es.minus[0])
321 }
322
323
324 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
325 b[i], b[j] = b[j], b[i]
326 }
327
328 if int(v) < 2 {
329
330 if v == 0 {
331 b = append(b, es.decimal...)
332 }
333
334 for i := 0; i < 2-int(v); i++ {
335 b = append(b, '0')
336 }
337 }
338
339 return string(b)
340 }
341
342
343
344 func (es *es_CO) FmtAccounting(num float64, v uint64, currency currency.Type) string {
345
346 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
347 symbol := es.currencies[currency]
348 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
349 count := 0
350 inWhole := v == 0
351 b := make([]byte, 0, l)
352
353 for i := len(s) - 1; i >= 0; i-- {
354
355 if s[i] == '.' {
356 b = append(b, es.decimal[0])
357 inWhole = true
358 continue
359 }
360
361 if inWhole {
362 if count == 3 {
363 b = append(b, es.group[0])
364 count = 1
365 } else {
366 count++
367 }
368 }
369
370 b = append(b, s[i])
371 }
372
373 if num < 0 {
374
375 for j := len(symbol) - 1; j >= 0; j-- {
376 b = append(b, symbol[j])
377 }
378
379 for j := len(es.currencyNegativePrefix) - 1; j >= 0; j-- {
380 b = append(b, es.currencyNegativePrefix[j])
381 }
382
383 b = append(b, es.minus[0])
384
385 } else {
386
387 for j := len(symbol) - 1; j >= 0; j-- {
388 b = append(b, symbol[j])
389 }
390
391 for j := len(es.currencyPositivePrefix) - 1; j >= 0; j-- {
392 b = append(b, es.currencyPositivePrefix[j])
393 }
394
395 }
396
397
398 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
399 b[i], b[j] = b[j], b[i]
400 }
401
402 if int(v) < 2 {
403
404 if v == 0 {
405 b = append(b, es.decimal...)
406 }
407
408 for i := 0; i < 2-int(v); i++ {
409 b = append(b, '0')
410 }
411 }
412
413 return string(b)
414 }
415
416
417 func (es *es_CO) FmtDateShort(t time.Time) string {
418
419 b := make([]byte, 0, 32)
420
421 b = strconv.AppendInt(b, int64(t.Day()), 10)
422 b = append(b, []byte{0x2f}...)
423
424 if t.Month() < 10 {
425 b = append(b, '0')
426 }
427
428 b = strconv.AppendInt(b, int64(t.Month()), 10)
429
430 b = append(b, []byte{0x2f}...)
431
432 if t.Year() > 9 {
433 b = append(b, strconv.Itoa(t.Year())[2:]...)
434 } else {
435 b = append(b, strconv.Itoa(t.Year())[1:]...)
436 }
437
438 return string(b)
439 }
440
441
442 func (es *es_CO) FmtDateMedium(t time.Time) string {
443
444 b := make([]byte, 0, 32)
445
446 b = strconv.AppendInt(b, int64(t.Day()), 10)
447 b = append(b, []byte{0x2f}...)
448
449 if t.Month() < 10 {
450 b = append(b, '0')
451 }
452
453 b = strconv.AppendInt(b, int64(t.Month()), 10)
454
455 b = append(b, []byte{0x2f}...)
456
457 if t.Year() > 0 {
458 b = strconv.AppendInt(b, int64(t.Year()), 10)
459 } else {
460 b = strconv.AppendInt(b, int64(-t.Year()), 10)
461 }
462
463 return string(b)
464 }
465
466
467 func (es *es_CO) FmtDateLong(t time.Time) string {
468
469 b := make([]byte, 0, 32)
470
471 b = strconv.AppendInt(b, int64(t.Day()), 10)
472 b = append(b, []byte{0x20, 0x64, 0x65}...)
473 b = append(b, []byte{0x20}...)
474 b = append(b, es.monthsWide[t.Month()]...)
475 b = append(b, []byte{0x20, 0x64, 0x65}...)
476 b = append(b, []byte{0x20}...)
477
478 if t.Year() > 0 {
479 b = strconv.AppendInt(b, int64(t.Year()), 10)
480 } else {
481 b = strconv.AppendInt(b, int64(-t.Year()), 10)
482 }
483
484 return string(b)
485 }
486
487
488 func (es *es_CO) FmtDateFull(t time.Time) string {
489
490 b := make([]byte, 0, 32)
491
492 b = append(b, es.daysWide[t.Weekday()]...)
493 b = append(b, []byte{0x2c, 0x20}...)
494 b = strconv.AppendInt(b, int64(t.Day()), 10)
495 b = append(b, []byte{0x20, 0x64, 0x65}...)
496 b = append(b, []byte{0x20}...)
497 b = append(b, es.monthsWide[t.Month()]...)
498 b = append(b, []byte{0x20, 0x64, 0x65}...)
499 b = append(b, []byte{0x20}...)
500
501 if t.Year() > 0 {
502 b = strconv.AppendInt(b, int64(t.Year()), 10)
503 } else {
504 b = strconv.AppendInt(b, int64(-t.Year()), 10)
505 }
506
507 return string(b)
508 }
509
510
511 func (es *es_CO) FmtTimeShort(t time.Time) string {
512
513 b := make([]byte, 0, 32)
514
515 h := t.Hour()
516
517 if h > 12 {
518 h -= 12
519 }
520
521 b = strconv.AppendInt(b, int64(h), 10)
522 b = append(b, es.timeSeparator...)
523
524 if t.Minute() < 10 {
525 b = append(b, '0')
526 }
527
528 b = strconv.AppendInt(b, int64(t.Minute()), 10)
529 b = append(b, []byte{0x20}...)
530
531 if t.Hour() < 12 {
532 b = append(b, es.periodsAbbreviated[0]...)
533 } else {
534 b = append(b, es.periodsAbbreviated[1]...)
535 }
536
537 return string(b)
538 }
539
540
541 func (es *es_CO) FmtTimeMedium(t time.Time) string {
542
543 b := make([]byte, 0, 32)
544
545 h := t.Hour()
546
547 if h > 12 {
548 h -= 12
549 }
550
551 b = strconv.AppendInt(b, int64(h), 10)
552 b = append(b, es.timeSeparator...)
553
554 if t.Minute() < 10 {
555 b = append(b, '0')
556 }
557
558 b = strconv.AppendInt(b, int64(t.Minute()), 10)
559 b = append(b, es.timeSeparator...)
560
561 if t.Second() < 10 {
562 b = append(b, '0')
563 }
564
565 b = strconv.AppendInt(b, int64(t.Second()), 10)
566 b = append(b, []byte{0x20}...)
567
568 if t.Hour() < 12 {
569 b = append(b, es.periodsAbbreviated[0]...)
570 } else {
571 b = append(b, es.periodsAbbreviated[1]...)
572 }
573
574 return string(b)
575 }
576
577
578 func (es *es_CO) FmtTimeLong(t time.Time) string {
579
580 b := make([]byte, 0, 32)
581
582 h := t.Hour()
583
584 if h > 12 {
585 h -= 12
586 }
587
588 b = strconv.AppendInt(b, int64(h), 10)
589 b = append(b, es.timeSeparator...)
590
591 if t.Minute() < 10 {
592 b = append(b, '0')
593 }
594
595 b = strconv.AppendInt(b, int64(t.Minute()), 10)
596 b = append(b, es.timeSeparator...)
597
598 if t.Second() < 10 {
599 b = append(b, '0')
600 }
601
602 b = strconv.AppendInt(b, int64(t.Second()), 10)
603 b = append(b, []byte{0x20}...)
604
605 if t.Hour() < 12 {
606 b = append(b, es.periodsAbbreviated[0]...)
607 } else {
608 b = append(b, es.periodsAbbreviated[1]...)
609 }
610
611 b = append(b, []byte{0x20}...)
612
613 tz, _ := t.Zone()
614 b = append(b, tz...)
615
616 return string(b)
617 }
618
619
620 func (es *es_CO) FmtTimeFull(t time.Time) string {
621
622 b := make([]byte, 0, 32)
623
624 h := t.Hour()
625
626 if h > 12 {
627 h -= 12
628 }
629
630 b = strconv.AppendInt(b, int64(h), 10)
631 b = append(b, es.timeSeparator...)
632
633 if t.Minute() < 10 {
634 b = append(b, '0')
635 }
636
637 b = strconv.AppendInt(b, int64(t.Minute()), 10)
638 b = append(b, es.timeSeparator...)
639
640 if t.Second() < 10 {
641 b = append(b, '0')
642 }
643
644 b = strconv.AppendInt(b, int64(t.Second()), 10)
645 b = append(b, []byte{0x20}...)
646
647 if t.Hour() < 12 {
648 b = append(b, es.periodsAbbreviated[0]...)
649 } else {
650 b = append(b, es.periodsAbbreviated[1]...)
651 }
652
653 b = append(b, []byte{0x20}...)
654
655 tz, _ := t.Zone()
656
657 if btz, ok := es.timezones[tz]; ok {
658 b = append(b, btz...)
659 } else {
660 b = append(b, tz...)
661 }
662
663 return string(b)
664 }
665
View as plain text