gv_IM.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. package gv_IM
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type gv_IM struct {
  10. locale string
  11. pluralsCardinal []locales.PluralRule
  12. pluralsOrdinal []locales.PluralRule
  13. pluralsRange []locales.PluralRule
  14. decimal string
  15. group string
  16. minus string
  17. percent string
  18. perMille string
  19. timeSeparator string
  20. inifinity string
  21. currencies []string // idx = enum of currency code
  22. monthsAbbreviated []string
  23. monthsNarrow []string
  24. monthsWide []string
  25. daysAbbreviated []string
  26. daysNarrow []string
  27. daysShort []string
  28. daysWide []string
  29. periodsAbbreviated []string
  30. periodsNarrow []string
  31. periodsShort []string
  32. periodsWide []string
  33. erasAbbreviated []string
  34. erasNarrow []string
  35. erasWide []string
  36. timezones map[string]string
  37. }
  38. // New returns a new instance of translator for the 'gv_IM' locale
  39. func New() locales.Translator {
  40. return &gv_IM{
  41. locale: "gv_IM",
  42. pluralsCardinal: []locales.PluralRule{2, 3, 4, 5, 6},
  43. pluralsOrdinal: nil,
  44. pluralsRange: nil,
  45. timeSeparator: ":",
  46. 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", "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", "UZS", "VEB", "VEF", "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"},
  47. monthsAbbreviated: []string{"", "J-guer", "T-arree", "Mayrnt", "Avrril", "Boaldyn", "M-souree", "J-souree", "Luanistyn", "M-fouyir", "J-fouyir", "M-Houney", "M-Nollick"},
  48. monthsWide: []string{"", "Jerrey-geuree", "Toshiaght-arree", "Mayrnt", "Averil", "Boaldyn", "Mean-souree", "Jerrey-souree", "Luanistyn", "Mean-fouyir", "Jerrey-fouyir", "Mee Houney", "Mee ny Nollick"},
  49. daysAbbreviated: []string{"Jed", "Jel", "Jem", "Jerc", "Jerd", "Jeh", "Jes"},
  50. daysWide: []string{"Jedoonee", "Jelhein", "Jemayrt", "Jercean", "Jerdein", "Jeheiney", "Jesarn"},
  51. periodsAbbreviated: []string{"a.m.", "p.m."},
  52. periodsWide: []string{"a.m.", "p.m."},
  53. erasAbbreviated: []string{"RC", "AD"},
  54. erasNarrow: []string{"", ""},
  55. erasWide: []string{"", ""},
  56. timezones: map[string]string{"MST": "MST", "WIB": "WIB", "SGT": "SGT", "COT": "COT", "WEZ": "WEZ", "BT": "BT", "ACWDT": "ACWDT", "WART": "WART", "HAT": "HAT", "GFT": "GFT", "ECT": "ECT", "CHADT": "CHADT", "ADT": "ADT", "MDT": "MDT", "WAST": "WAST", "HEOG": "HEOG", "TMST": "TMST", "GYT": "GYT", "HNOG": "HNOG", "ART": "ART", "UYT": "UYT", "AWST": "AWST", "∅∅∅": "∅∅∅", "JST": "JST", "ACWST": "ACWST", "MESZ": "MESZ", "VET": "VET", "HNCU": "HNCU", "HNEG": "HNEG", "MEZ": "MEZ", "HKT": "HKT", "WARST": "WARST", "HNNOMX": "HNNOMX", "HEPM": "HEPM", "CLST": "CLST", "AEDT": "AEDT", "SAST": "SAST", "WESZ": "WESZ", "EDT": "EDT", "HKST": "HKST", "LHDT": "LHDT", "WAT": "WAT", "JDT": "JDT", "LHST": "LHST", "CAT": "CAT", "CST": "CST", "AWDT": "AWDT", "AST": "AST", "NZST": "NZST", "HNT": "HNT", "HADT": "HADT", "HNPMX": "HNPMX", "HNPM": "HNPM", "COST": "COST", "OEZ": "OEZ", "OESZ": "OESZ", "HEPMX": "HEPMX", "BOT": "BOT", "AKDT": "AKDT", "ACDT": "ACDT", "SRT": "SRT", "EAT": "EAT", "HECU": "HECU", "ChST": "ChST", "MYT": "MYT", "EST": "EST", "IST": "IST", "WITA": "WITA", "WIT": "WIT", "ARST": "ARST", "AEST": "AEST", "ACST": "ACST", "CLT": "CLT", "UYST": "UYST", "CHAST": "CHAST", "HAST": "HAST", "GMT": "GMT", "CDT": "CDT", "PST": "PST", "PDT": "PDT", "AKST": "AKST", "HENOMX": "HENOMX", "TMT": "TMT", "NZDT": "NZDT", "HEEG": "HEEG"},
  57. }
  58. }
  59. // Locale returns the current translators string locale
  60. func (gv *gv_IM) Locale() string {
  61. return gv.locale
  62. }
  63. // PluralsCardinal returns the list of cardinal plural rules associated with 'gv_IM'
  64. func (gv *gv_IM) PluralsCardinal() []locales.PluralRule {
  65. return gv.pluralsCardinal
  66. }
  67. // PluralsOrdinal returns the list of ordinal plural rules associated with 'gv_IM'
  68. func (gv *gv_IM) PluralsOrdinal() []locales.PluralRule {
  69. return gv.pluralsOrdinal
  70. }
  71. // PluralsRange returns the list of range plural rules associated with 'gv_IM'
  72. func (gv *gv_IM) PluralsRange() []locales.PluralRule {
  73. return gv.pluralsRange
  74. }
  75. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'gv_IM'
  76. func (gv *gv_IM) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  77. n := math.Abs(num)
  78. i := int64(n)
  79. iMod100 := i % 100
  80. iMod10 := i % 10
  81. if v == 0 && iMod10 == 1 {
  82. return locales.PluralRuleOne
  83. } else if v == 0 && iMod10 == 2 {
  84. return locales.PluralRuleTwo
  85. } else if v == 0 && (iMod100 == 0 || iMod100 == 20 || iMod100 == 40 || iMod100 == 60 || iMod100 == 80) {
  86. return locales.PluralRuleFew
  87. } else if v != 0 {
  88. return locales.PluralRuleMany
  89. }
  90. return locales.PluralRuleOther
  91. }
  92. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'gv_IM'
  93. func (gv *gv_IM) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  94. return locales.PluralRuleUnknown
  95. }
  96. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'gv_IM'
  97. func (gv *gv_IM) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  98. return locales.PluralRuleUnknown
  99. }
  100. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  101. func (gv *gv_IM) MonthAbbreviated(month time.Month) string {
  102. return gv.monthsAbbreviated[month]
  103. }
  104. // MonthsAbbreviated returns the locales abbreviated months
  105. func (gv *gv_IM) MonthsAbbreviated() []string {
  106. return gv.monthsAbbreviated[1:]
  107. }
  108. // MonthNarrow returns the locales narrow month given the 'month' provided
  109. func (gv *gv_IM) MonthNarrow(month time.Month) string {
  110. return gv.monthsNarrow[month]
  111. }
  112. // MonthsNarrow returns the locales narrow months
  113. func (gv *gv_IM) MonthsNarrow() []string {
  114. return nil
  115. }
  116. // MonthWide returns the locales wide month given the 'month' provided
  117. func (gv *gv_IM) MonthWide(month time.Month) string {
  118. return gv.monthsWide[month]
  119. }
  120. // MonthsWide returns the locales wide months
  121. func (gv *gv_IM) MonthsWide() []string {
  122. return gv.monthsWide[1:]
  123. }
  124. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  125. func (gv *gv_IM) WeekdayAbbreviated(weekday time.Weekday) string {
  126. return gv.daysAbbreviated[weekday]
  127. }
  128. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  129. func (gv *gv_IM) WeekdaysAbbreviated() []string {
  130. return gv.daysAbbreviated
  131. }
  132. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  133. func (gv *gv_IM) WeekdayNarrow(weekday time.Weekday) string {
  134. return gv.daysNarrow[weekday]
  135. }
  136. // WeekdaysNarrow returns the locales narrow weekdays
  137. func (gv *gv_IM) WeekdaysNarrow() []string {
  138. return gv.daysNarrow
  139. }
  140. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  141. func (gv *gv_IM) WeekdayShort(weekday time.Weekday) string {
  142. return gv.daysShort[weekday]
  143. }
  144. // WeekdaysShort returns the locales short weekdays
  145. func (gv *gv_IM) WeekdaysShort() []string {
  146. return gv.daysShort
  147. }
  148. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  149. func (gv *gv_IM) WeekdayWide(weekday time.Weekday) string {
  150. return gv.daysWide[weekday]
  151. }
  152. // WeekdaysWide returns the locales wide weekdays
  153. func (gv *gv_IM) WeekdaysWide() []string {
  154. return gv.daysWide
  155. }
  156. // Decimal returns the decimal point of number
  157. func (gv *gv_IM) Decimal() string {
  158. return gv.decimal
  159. }
  160. // Group returns the group of number
  161. func (gv *gv_IM) Group() string {
  162. return gv.group
  163. }
  164. // Group returns the minus sign of number
  165. func (gv *gv_IM) Minus() string {
  166. return gv.minus
  167. }
  168. // FmtNumber returns 'num' with digits/precision of 'v' for 'gv_IM' and handles both Whole and Real numbers based on 'v'
  169. func (gv *gv_IM) FmtNumber(num float64, v uint64) string {
  170. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  171. }
  172. // FmtPercent returns 'num' with digits/precision of 'v' for 'gv_IM' and handles both Whole and Real numbers based on 'v'
  173. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  174. func (gv *gv_IM) FmtPercent(num float64, v uint64) string {
  175. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  176. }
  177. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'gv_IM'
  178. func (gv *gv_IM) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  179. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  180. symbol := gv.currencies[currency]
  181. l := len(s) + len(symbol) + 0
  182. count := 0
  183. inWhole := v == 0
  184. b := make([]byte, 0, l)
  185. for i := len(s) - 1; i >= 0; i-- {
  186. if s[i] == '.' {
  187. b = append(b, gv.decimal[0])
  188. inWhole = true
  189. continue
  190. }
  191. if inWhole {
  192. if count == 3 {
  193. b = append(b, gv.group[0])
  194. count = 1
  195. } else {
  196. count++
  197. }
  198. }
  199. b = append(b, s[i])
  200. }
  201. for j := len(symbol) - 1; j >= 0; j-- {
  202. b = append(b, symbol[j])
  203. }
  204. if num < 0 {
  205. b = append(b, gv.minus[0])
  206. }
  207. // reverse
  208. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  209. b[i], b[j] = b[j], b[i]
  210. }
  211. if int(v) < 2 {
  212. if v == 0 {
  213. b = append(b, gv.decimal...)
  214. }
  215. for i := 0; i < 2-int(v); i++ {
  216. b = append(b, '0')
  217. }
  218. }
  219. return string(b)
  220. }
  221. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'gv_IM'
  222. // in accounting notation.
  223. func (gv *gv_IM) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  224. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  225. symbol := gv.currencies[currency]
  226. l := len(s) + len(symbol) + 0
  227. count := 0
  228. inWhole := v == 0
  229. b := make([]byte, 0, l)
  230. for i := len(s) - 1; i >= 0; i-- {
  231. if s[i] == '.' {
  232. b = append(b, gv.decimal[0])
  233. inWhole = true
  234. continue
  235. }
  236. if inWhole {
  237. if count == 3 {
  238. b = append(b, gv.group[0])
  239. count = 1
  240. } else {
  241. count++
  242. }
  243. }
  244. b = append(b, s[i])
  245. }
  246. if num < 0 {
  247. for j := len(symbol) - 1; j >= 0; j-- {
  248. b = append(b, symbol[j])
  249. }
  250. b = append(b, gv.minus[0])
  251. } else {
  252. for j := len(symbol) - 1; j >= 0; j-- {
  253. b = append(b, symbol[j])
  254. }
  255. }
  256. // reverse
  257. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  258. b[i], b[j] = b[j], b[i]
  259. }
  260. if int(v) < 2 {
  261. if v == 0 {
  262. b = append(b, gv.decimal...)
  263. }
  264. for i := 0; i < 2-int(v); i++ {
  265. b = append(b, '0')
  266. }
  267. }
  268. return string(b)
  269. }
  270. // FmtDateShort returns the short date representation of 't' for 'gv_IM'
  271. func (gv *gv_IM) FmtDateShort(t time.Time) string {
  272. b := make([]byte, 0, 32)
  273. if t.Day() < 10 {
  274. b = append(b, '0')
  275. }
  276. b = strconv.AppendInt(b, int64(t.Day()), 10)
  277. b = append(b, []byte{0x2f}...)
  278. if t.Month() < 10 {
  279. b = append(b, '0')
  280. }
  281. b = strconv.AppendInt(b, int64(t.Month()), 10)
  282. b = append(b, []byte{0x2f}...)
  283. if t.Year() > 9 {
  284. b = append(b, strconv.Itoa(t.Year())[2:]...)
  285. } else {
  286. b = append(b, strconv.Itoa(t.Year())[1:]...)
  287. }
  288. return string(b)
  289. }
  290. // FmtDateMedium returns the medium date representation of 't' for 'gv_IM'
  291. func (gv *gv_IM) FmtDateMedium(t time.Time) string {
  292. b := make([]byte, 0, 32)
  293. b = append(b, gv.monthsAbbreviated[t.Month()]...)
  294. b = append(b, []byte{0x20}...)
  295. if t.Day() < 10 {
  296. b = append(b, '0')
  297. }
  298. b = strconv.AppendInt(b, int64(t.Day()), 10)
  299. b = append(b, []byte{0x2c, 0x20}...)
  300. if t.Year() > 0 {
  301. b = strconv.AppendInt(b, int64(t.Year()), 10)
  302. } else {
  303. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  304. }
  305. return string(b)
  306. }
  307. // FmtDateLong returns the long date representation of 't' for 'gv_IM'
  308. func (gv *gv_IM) FmtDateLong(t time.Time) string {
  309. b := make([]byte, 0, 32)
  310. if t.Day() < 10 {
  311. b = append(b, '0')
  312. }
  313. b = strconv.AppendInt(b, int64(t.Day()), 10)
  314. b = append(b, []byte{0x20}...)
  315. b = append(b, gv.monthsWide[t.Month()]...)
  316. b = append(b, []byte{0x20}...)
  317. if t.Year() > 0 {
  318. b = strconv.AppendInt(b, int64(t.Year()), 10)
  319. } else {
  320. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  321. }
  322. return string(b)
  323. }
  324. // FmtDateFull returns the full date representation of 't' for 'gv_IM'
  325. func (gv *gv_IM) FmtDateFull(t time.Time) string {
  326. b := make([]byte, 0, 32)
  327. b = append(b, gv.daysWide[t.Weekday()]...)
  328. b = append(b, []byte{0x20}...)
  329. if t.Day() < 10 {
  330. b = append(b, '0')
  331. }
  332. b = strconv.AppendInt(b, int64(t.Day()), 10)
  333. b = append(b, []byte{0x20}...)
  334. b = append(b, gv.monthsWide[t.Month()]...)
  335. b = append(b, []byte{0x20}...)
  336. if t.Year() > 0 {
  337. b = strconv.AppendInt(b, int64(t.Year()), 10)
  338. } else {
  339. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  340. }
  341. return string(b)
  342. }
  343. // FmtTimeShort returns the short time representation of 't' for 'gv_IM'
  344. func (gv *gv_IM) FmtTimeShort(t time.Time) string {
  345. b := make([]byte, 0, 32)
  346. if t.Hour() < 10 {
  347. b = append(b, '0')
  348. }
  349. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  350. b = append(b, gv.timeSeparator...)
  351. if t.Minute() < 10 {
  352. b = append(b, '0')
  353. }
  354. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  355. return string(b)
  356. }
  357. // FmtTimeMedium returns the medium time representation of 't' for 'gv_IM'
  358. func (gv *gv_IM) FmtTimeMedium(t time.Time) string {
  359. b := make([]byte, 0, 32)
  360. if t.Hour() < 10 {
  361. b = append(b, '0')
  362. }
  363. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  364. b = append(b, gv.timeSeparator...)
  365. if t.Minute() < 10 {
  366. b = append(b, '0')
  367. }
  368. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  369. b = append(b, gv.timeSeparator...)
  370. if t.Second() < 10 {
  371. b = append(b, '0')
  372. }
  373. b = strconv.AppendInt(b, int64(t.Second()), 10)
  374. return string(b)
  375. }
  376. // FmtTimeLong returns the long time representation of 't' for 'gv_IM'
  377. func (gv *gv_IM) FmtTimeLong(t time.Time) string {
  378. b := make([]byte, 0, 32)
  379. if t.Hour() < 10 {
  380. b = append(b, '0')
  381. }
  382. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  383. b = append(b, gv.timeSeparator...)
  384. if t.Minute() < 10 {
  385. b = append(b, '0')
  386. }
  387. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  388. b = append(b, gv.timeSeparator...)
  389. if t.Second() < 10 {
  390. b = append(b, '0')
  391. }
  392. b = strconv.AppendInt(b, int64(t.Second()), 10)
  393. b = append(b, []byte{0x20}...)
  394. tz, _ := t.Zone()
  395. b = append(b, tz...)
  396. return string(b)
  397. }
  398. // FmtTimeFull returns the full time representation of 't' for 'gv_IM'
  399. func (gv *gv_IM) FmtTimeFull(t time.Time) string {
  400. b := make([]byte, 0, 32)
  401. if t.Hour() < 10 {
  402. b = append(b, '0')
  403. }
  404. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  405. b = append(b, gv.timeSeparator...)
  406. if t.Minute() < 10 {
  407. b = append(b, '0')
  408. }
  409. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  410. b = append(b, gv.timeSeparator...)
  411. if t.Second() < 10 {
  412. b = append(b, '0')
  413. }
  414. b = strconv.AppendInt(b, int64(t.Second()), 10)
  415. b = append(b, []byte{0x20}...)
  416. tz, _ := t.Zone()
  417. if btz, ok := gv.timezones[tz]; ok {
  418. b = append(b, btz...)
  419. } else {
  420. b = append(b, tz...)
  421. }
  422. return string(b)
  423. }