1 package uz
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 uz 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 currencyPositiveSuffix string
26 currencyNegativeSuffix 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 &uz{
47 locale: "uz",
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", "A$", "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", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "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", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "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", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "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", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UYW", "soʻm", "VEB", "VEF", "VES", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
59 currencyPositiveSuffix: " ",
60 currencyNegativeSuffix: " ",
61 monthsAbbreviated: []string{"", "yan", "fev", "mar", "apr", "may", "iyn", "iyl", "avg", "sen", "okt", "noy", "dek"},
62 monthsNarrow: []string{"", "Y", "F", "M", "A", "M", "I", "I", "A", "S", "O", "N", "D"},
63 monthsWide: []string{"", "yanvar", "fevral", "mart", "aprel", "may", "iyun", "iyul", "avgust", "sentabr", "oktabr", "noyabr", "dekabr"},
64 daysAbbreviated: []string{"Yak", "Dush", "Sesh", "Chor", "Pay", "Jum", "Shan"},
65 daysNarrow: []string{"Y", "D", "S", "C", "P", "J", "S"},
66 daysShort: []string{"Ya", "Du", "Se", "Ch", "Pa", "Ju", "Sh"},
67 daysWide: []string{"yakshanba", "dushanba", "seshanba", "chorshanba", "payshanba", "juma", "shanba"},
68 periodsAbbreviated: []string{"TO", "TK"},
69 periodsNarrow: []string{"TO", "TK"},
70 periodsWide: []string{"TO", "TK"},
71 erasAbbreviated: []string{"m.a.", "milodiy"},
72 erasNarrow: []string{"", ""},
73 erasWide: []string{"miloddan avvalgi", "milodiy"},
74 timezones: map[string]string{"ACDT": "Markaziy Avstraliya yozgi vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "ADT": "Atlantika yozgi vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "AKDT": "Alyaska yozgi vaqti", "AKST": "Alyaska standart vaqti", "ARST": "Argentina yozgi vaqti", "ART": "Argentina standart vaqti", "AST": "Atlantika standart vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "BOT": "Boliviya vaqti", "BT": "Butan vaqti", "CAT": "Markaziy Afrika vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "CHADT": "Chatem yozgi vaqti", "CHAST": "Chatem standart vaqti", "CLST": "Chili yozgi vaqti", "CLT": "Chili standart vaqti", "COST": "Kolumbiya yozgi vaqti", "COT": "Kolumbiya standart vaqti", "CST": "Markaziy Amerika standart vaqti", "ChST": "Chamorro standart vaqti", "EAT": "Sharqiy Afrika vaqti", "ECT": "Ekvador vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "EST": "Sharqiy Amerika standart vaqti", "GFT": "Fransuz Gvianasi vaqti", "GMT": "Grinvich o‘rtacha vaqti", "GST": "Fors ko‘rfazi standart vaqti", "GYT": "Gayana vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "HAST": "Gavayi-aleut standart vaqti", "HAT": "Nyufaundlend yozgi vaqti", "HECU": "Kuba yozgi vaqti", "HEEG": "Sharqiy Grenlandiya yozgi vaqti", "HENOMX": "Shimoli-g‘arbiy Meksika yozgi vaqti", "HEOG": "G‘arbiy Grenlandiya yozgi vaqti", "HEPM": "Sen-Pyer va Mikelon yozgi vaqti", "HEPMX": "Meksika Tinch okeani yozgi vaqti", "HKST": "Gonkong yozgi vaqti", "HKT": "Gonkong standart vaqti", "HNCU": "Kuba standart vaqti", "HNEG": "Sharqiy Grenlandiya standart vaqti", "HNNOMX": "Shimoli-g‘arbiy Meksika standart vaqti", "HNOG": "G‘arbiy Grenlandiya standart vaqti", "HNPM": "Sen-Pyer va Mikelon standart vaqti", "HNPMX": "Meksika Tinch okeani standart vaqti", "HNT": "Nyufaundlend standart vaqti", "IST": "Hindiston standart vaqti", "JDT": "Yaponiya yozgi vaqti", "JST": "Yaponiya standart vaqti", "LHDT": "Lord-Xau yozgi vaqti", "LHST": "Lord-Xau standart vaqti", "MDT": "Tog‘ yozgi vaqti (AQSH)", "MESZ": "Markaziy Yevropa yozgi vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "MST": "Tog‘ standart vaqti (AQSH)", "MYT": "Malayziya vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "NZST": "Yangi Zelandiya standart vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "PDT": "Tinch okeani yozgi vaqti", "PST": "Tinch okeani standart vaqti", "SAST": "Janubiy Afrika standart vaqti", "SGT": "Singapur vaqti", "SRT": "Surinam vaqti", "TMST": "Turkmaniston yozgi vaqti", "TMT": "Turkmaniston standart vaqti", "UYST": "Urugvay yozgi vaqti", "UYT": "Urugvay standart vaqti", "VET": "Venesuela vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "WIT": "Sharqiy Indoneziya vaqti", "WITA": "Markaziy Indoneziya vaqti", "∅∅∅": "Braziliya yozgi vaqti"},
75 }
76 }
77
78
79 func (uz *uz) Locale() string {
80 return uz.locale
81 }
82
83
84 func (uz *uz) PluralsCardinal() []locales.PluralRule {
85 return uz.pluralsCardinal
86 }
87
88
89 func (uz *uz) PluralsOrdinal() []locales.PluralRule {
90 return uz.pluralsOrdinal
91 }
92
93
94 func (uz *uz) PluralsRange() []locales.PluralRule {
95 return uz.pluralsRange
96 }
97
98
99 func (uz *uz) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101 n := math.Abs(num)
102
103 if n == 1 {
104 return locales.PluralRuleOne
105 }
106
107 return locales.PluralRuleOther
108 }
109
110
111 func (uz *uz) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
112 return locales.PluralRuleOther
113 }
114
115
116 func (uz *uz) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
117
118 start := uz.CardinalPluralRule(num1, v1)
119 end := uz.CardinalPluralRule(num2, v2)
120
121 if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
122 return locales.PluralRuleOther
123 } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
124 return locales.PluralRuleOne
125 }
126
127 return locales.PluralRuleOther
128
129 }
130
131
132 func (uz *uz) MonthAbbreviated(month time.Month) string {
133 return uz.monthsAbbreviated[month]
134 }
135
136
137 func (uz *uz) MonthsAbbreviated() []string {
138 return uz.monthsAbbreviated[1:]
139 }
140
141
142 func (uz *uz) MonthNarrow(month time.Month) string {
143 return uz.monthsNarrow[month]
144 }
145
146
147 func (uz *uz) MonthsNarrow() []string {
148 return uz.monthsNarrow[1:]
149 }
150
151
152 func (uz *uz) MonthWide(month time.Month) string {
153 return uz.monthsWide[month]
154 }
155
156
157 func (uz *uz) MonthsWide() []string {
158 return uz.monthsWide[1:]
159 }
160
161
162 func (uz *uz) WeekdayAbbreviated(weekday time.Weekday) string {
163 return uz.daysAbbreviated[weekday]
164 }
165
166
167 func (uz *uz) WeekdaysAbbreviated() []string {
168 return uz.daysAbbreviated
169 }
170
171
172 func (uz *uz) WeekdayNarrow(weekday time.Weekday) string {
173 return uz.daysNarrow[weekday]
174 }
175
176
177 func (uz *uz) WeekdaysNarrow() []string {
178 return uz.daysNarrow
179 }
180
181
182 func (uz *uz) WeekdayShort(weekday time.Weekday) string {
183 return uz.daysShort[weekday]
184 }
185
186
187 func (uz *uz) WeekdaysShort() []string {
188 return uz.daysShort
189 }
190
191
192 func (uz *uz) WeekdayWide(weekday time.Weekday) string {
193 return uz.daysWide[weekday]
194 }
195
196
197 func (uz *uz) WeekdaysWide() []string {
198 return uz.daysWide
199 }
200
201
202 func (uz *uz) Decimal() string {
203 return uz.decimal
204 }
205
206
207 func (uz *uz) Group() string {
208 return uz.group
209 }
210
211
212 func (uz *uz) Minus() string {
213 return uz.minus
214 }
215
216
217 func (uz *uz) FmtNumber(num float64, v uint64) string {
218
219 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
220 l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
221 count := 0
222 inWhole := v == 0
223 b := make([]byte, 0, l)
224
225 for i := len(s) - 1; i >= 0; i-- {
226
227 if s[i] == '.' {
228 b = append(b, uz.decimal[0])
229 inWhole = true
230 continue
231 }
232
233 if inWhole {
234 if count == 3 {
235 for j := len(uz.group) - 1; j >= 0; j-- {
236 b = append(b, uz.group[j])
237 }
238 count = 1
239 } else {
240 count++
241 }
242 }
243
244 b = append(b, s[i])
245 }
246
247 if num < 0 {
248 b = append(b, uz.minus[0])
249 }
250
251
252 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
253 b[i], b[j] = b[j], b[i]
254 }
255
256 return string(b)
257 }
258
259
260
261 func (uz *uz) FmtPercent(num float64, v uint64) string {
262 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
263 l := len(s) + 3
264 b := make([]byte, 0, l)
265
266 for i := len(s) - 1; i >= 0; i-- {
267
268 if s[i] == '.' {
269 b = append(b, uz.decimal[0])
270 continue
271 }
272
273 b = append(b, s[i])
274 }
275
276 if num < 0 {
277 b = append(b, uz.minus[0])
278 }
279
280
281 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
282 b[i], b[j] = b[j], b[i]
283 }
284
285 b = append(b, uz.percent...)
286
287 return string(b)
288 }
289
290
291 func (uz *uz) FmtCurrency(num float64, v uint64, currency currency.Type) string {
292
293 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
294 symbol := uz.currencies[currency]
295 l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
296 count := 0
297 inWhole := v == 0
298 b := make([]byte, 0, l)
299
300 for i := len(s) - 1; i >= 0; i-- {
301
302 if s[i] == '.' {
303 b = append(b, uz.decimal[0])
304 inWhole = true
305 continue
306 }
307
308 if inWhole {
309 if count == 3 {
310 for j := len(uz.group) - 1; j >= 0; j-- {
311 b = append(b, uz.group[j])
312 }
313 count = 1
314 } else {
315 count++
316 }
317 }
318
319 b = append(b, s[i])
320 }
321
322 if num < 0 {
323 b = append(b, uz.minus[0])
324 }
325
326
327 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
328 b[i], b[j] = b[j], b[i]
329 }
330
331 if int(v) < 2 {
332
333 if v == 0 {
334 b = append(b, uz.decimal...)
335 }
336
337 for i := 0; i < 2-int(v); i++ {
338 b = append(b, '0')
339 }
340 }
341
342 b = append(b, uz.currencyPositiveSuffix...)
343
344 b = append(b, symbol...)
345
346 return string(b)
347 }
348
349
350
351 func (uz *uz) FmtAccounting(num float64, v uint64, currency currency.Type) string {
352
353 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
354 symbol := uz.currencies[currency]
355 l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
356 count := 0
357 inWhole := v == 0
358 b := make([]byte, 0, l)
359
360 for i := len(s) - 1; i >= 0; i-- {
361
362 if s[i] == '.' {
363 b = append(b, uz.decimal[0])
364 inWhole = true
365 continue
366 }
367
368 if inWhole {
369 if count == 3 {
370 for j := len(uz.group) - 1; j >= 0; j-- {
371 b = append(b, uz.group[j])
372 }
373 count = 1
374 } else {
375 count++
376 }
377 }
378
379 b = append(b, s[i])
380 }
381
382 if num < 0 {
383
384 b = append(b, uz.minus[0])
385
386 }
387
388
389 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
390 b[i], b[j] = b[j], b[i]
391 }
392
393 if int(v) < 2 {
394
395 if v == 0 {
396 b = append(b, uz.decimal...)
397 }
398
399 for i := 0; i < 2-int(v); i++ {
400 b = append(b, '0')
401 }
402 }
403
404 if num < 0 {
405 b = append(b, uz.currencyNegativeSuffix...)
406 b = append(b, symbol...)
407 } else {
408
409 b = append(b, uz.currencyPositiveSuffix...)
410 b = append(b, symbol...)
411 }
412
413 return string(b)
414 }
415
416
417 func (uz *uz) FmtDateShort(t time.Time) string {
418
419 b := make([]byte, 0, 32)
420
421 if t.Day() < 10 {
422 b = append(b, '0')
423 }
424
425 b = strconv.AppendInt(b, int64(t.Day()), 10)
426 b = append(b, []byte{0x2f}...)
427
428 if t.Month() < 10 {
429 b = append(b, '0')
430 }
431
432 b = strconv.AppendInt(b, int64(t.Month()), 10)
433
434 b = append(b, []byte{0x2f}...)
435
436 if t.Year() > 9 {
437 b = append(b, strconv.Itoa(t.Year())[2:]...)
438 } else {
439 b = append(b, strconv.Itoa(t.Year())[1:]...)
440 }
441
442 return string(b)
443 }
444
445
446 func (uz *uz) FmtDateMedium(t time.Time) string {
447
448 b := make([]byte, 0, 32)
449
450 b = strconv.AppendInt(b, int64(t.Day()), 10)
451 b = append(b, []byte{0x2d}...)
452 b = append(b, uz.monthsAbbreviated[t.Month()]...)
453 b = append(b, []byte{0x2c, 0x20}...)
454
455 if t.Year() > 0 {
456 b = strconv.AppendInt(b, int64(t.Year()), 10)
457 } else {
458 b = strconv.AppendInt(b, int64(-t.Year()), 10)
459 }
460
461 return string(b)
462 }
463
464
465 func (uz *uz) FmtDateLong(t time.Time) string {
466
467 b := make([]byte, 0, 32)
468
469 b = strconv.AppendInt(b, int64(t.Day()), 10)
470 b = append(b, []byte{0x2d}...)
471 b = append(b, uz.monthsWide[t.Month()]...)
472 b = append(b, []byte{0x2c, 0x20}...)
473
474 if t.Year() > 0 {
475 b = strconv.AppendInt(b, int64(t.Year()), 10)
476 } else {
477 b = strconv.AppendInt(b, int64(-t.Year()), 10)
478 }
479
480 return string(b)
481 }
482
483
484 func (uz *uz) FmtDateFull(t time.Time) string {
485
486 b := make([]byte, 0, 32)
487
488 b = append(b, uz.daysWide[t.Weekday()]...)
489 b = append(b, []byte{0x2c, 0x20}...)
490 b = strconv.AppendInt(b, int64(t.Day()), 10)
491 b = append(b, []byte{0x2d}...)
492 b = append(b, uz.monthsWide[t.Month()]...)
493 b = append(b, []byte{0x2c, 0x20}...)
494
495 if t.Year() > 0 {
496 b = strconv.AppendInt(b, int64(t.Year()), 10)
497 } else {
498 b = strconv.AppendInt(b, int64(-t.Year()), 10)
499 }
500
501 return string(b)
502 }
503
504
505 func (uz *uz) FmtTimeShort(t time.Time) string {
506
507 b := make([]byte, 0, 32)
508
509 if t.Hour() < 10 {
510 b = append(b, '0')
511 }
512
513 b = strconv.AppendInt(b, int64(t.Hour()), 10)
514 b = append(b, uz.timeSeparator...)
515
516 if t.Minute() < 10 {
517 b = append(b, '0')
518 }
519
520 b = strconv.AppendInt(b, int64(t.Minute()), 10)
521
522 return string(b)
523 }
524
525
526 func (uz *uz) FmtTimeMedium(t time.Time) string {
527
528 b := make([]byte, 0, 32)
529
530 if t.Hour() < 10 {
531 b = append(b, '0')
532 }
533
534 b = strconv.AppendInt(b, int64(t.Hour()), 10)
535 b = append(b, uz.timeSeparator...)
536
537 if t.Minute() < 10 {
538 b = append(b, '0')
539 }
540
541 b = strconv.AppendInt(b, int64(t.Minute()), 10)
542 b = append(b, uz.timeSeparator...)
543
544 if t.Second() < 10 {
545 b = append(b, '0')
546 }
547
548 b = strconv.AppendInt(b, int64(t.Second()), 10)
549
550 return string(b)
551 }
552
553
554 func (uz *uz) FmtTimeLong(t time.Time) string {
555
556 b := make([]byte, 0, 32)
557
558 b = strconv.AppendInt(b, int64(t.Hour()), 10)
559 b = append(b, uz.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, uz.timeSeparator...)
567
568 if t.Second() < 10 {
569 b = append(b, '0')
570 }
571
572 b = strconv.AppendInt(b, int64(t.Second()), 10)
573 b = append(b, []byte{0x20, 0x28}...)
574
575 tz, _ := t.Zone()
576 b = append(b, tz...)
577
578 b = append(b, []byte{0x29}...)
579
580 return string(b)
581 }
582
583
584 func (uz *uz) FmtTimeFull(t time.Time) string {
585
586 b := make([]byte, 0, 32)
587
588 b = strconv.AppendInt(b, int64(t.Hour()), 10)
589 b = append(b, uz.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, uz.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, 0x28}...)
604
605 tz, _ := t.Zone()
606
607 if btz, ok := uz.timezones[tz]; ok {
608 b = append(b, btz...)
609 } else {
610 b = append(b, tz...)
611 }
612
613 b = append(b, []byte{0x29}...)
614
615 return string(b)
616 }
617
View as plain text