lag_TZ.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. package lag_TZ
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type lag_TZ 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. currencyPositivePrefix string
  23. currencyPositiveSuffix string
  24. currencyNegativePrefix string
  25. currencyNegativeSuffix string
  26. monthsAbbreviated []string
  27. monthsNarrow []string
  28. monthsWide []string
  29. daysAbbreviated []string
  30. daysNarrow []string
  31. daysShort []string
  32. daysWide []string
  33. periodsAbbreviated []string
  34. periodsNarrow []string
  35. periodsShort []string
  36. periodsWide []string
  37. erasAbbreviated []string
  38. erasNarrow []string
  39. erasWide []string
  40. timezones map[string]string
  41. }
  42. // New returns a new instance of translator for the 'lag_TZ' locale
  43. func New() locales.Translator {
  44. return &lag_TZ{
  45. locale: "lag_TZ",
  46. pluralsCardinal: []locales.PluralRule{1, 2, 6},
  47. pluralsOrdinal: nil,
  48. pluralsRange: nil,
  49. timeSeparator: ":",
  50. 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"},
  51. currencyPositivePrefix: " ",
  52. currencyPositiveSuffix: "K",
  53. currencyNegativePrefix: " ",
  54. currencyNegativeSuffix: "K",
  55. monthsAbbreviated: []string{"", "Fúngatɨ", "Naanɨ", "Keenda", "Ikúmi", "Inyambala", "Idwaata", "Mʉʉnchɨ", "Vɨɨrɨ", "Saatʉ", "Inyi", "Saano", "Sasatʉ"},
  56. monthsNarrow: []string{"", "F", "N", "K", "I", "I", "I", "M", "V", "S", "I", "S", "S"},
  57. monthsWide: []string{"", "Kʉfúngatɨ", "Kʉnaanɨ", "Kʉkeenda", "Kwiikumi", "Kwiinyambála", "Kwiidwaata", "Kʉmʉʉnchɨ", "Kʉvɨɨrɨ", "Kʉsaatʉ", "Kwiinyi", "Kʉsaano", "Kʉsasatʉ"},
  58. daysAbbreviated: []string{"Píili", "Táatu", "Íne", "Táano", "Alh", "Ijm", "Móosi"},
  59. daysNarrow: []string{"P", "T", "E", "O", "A", "I", "M"},
  60. daysWide: []string{"Jumapíiri", "Jumatátu", "Jumaíne", "Jumatáano", "Alamíisi", "Ijumáa", "Jumamóosi"},
  61. periodsAbbreviated: []string{"TOO", "MUU"},
  62. periodsWide: []string{"TOO", "MUU"},
  63. erasAbbreviated: []string{"KSA", "KA"},
  64. erasNarrow: []string{"", ""},
  65. erasWide: []string{"Kɨrɨsitʉ sɨ anavyaal", "Kɨrɨsitʉ akavyaalwe"},
  66. timezones: map[string]string{"ECT": "ECT", "HNEG": "HNEG", "MEZ": "MEZ", "OEZ": "OEZ", "ART": "ART", "WESZ": "WESZ", "HAT": "HAT", "COST": "COST", "HEPMX": "HEPMX", "TMT": "TMT", "WAT": "WAT", "NZST": "NZST", "SGT": "SGT", "ACDT": "ACDT", "ACWST": "ACWST", "HEPM": "HEPM", "WIT": "WIT", "AST": "AST", "WAST": "WAST", "GFT": "GFT", "AKDT": "AKDT", "HEOG": "HEOG", "WART": "WART", "ADT": "ADT", "AEDT": "AEDT", "HNOG": "HNOG", "CAT": "CAT", "UYT": "UYT", "CDT": "CDT", "EDT": "EDT", "IST": "IST", "HNNOMX": "HNNOMX", "OESZ": "OESZ", "AWST": "AWST", "AWDT": "AWDT", "VET": "VET", "CLST": "CLST", "COT": "COT", "HADT": "HADT", "GMT": "GMT", "CST": "CST", "AEST": "AEST", "WIB": "WIB", "JST": "JST", "GYT": "GYT", "HNCU": "HNCU", "HEEG": "HEEG", "HNPMX": "HNPMX", "PDT": "PDT", "HNT": "HNT", "HENOMX": "HENOMX", "∅∅∅": "∅∅∅", "ACST": "ACST", "LHDT": "LHDT", "HNPM": "HNPM", "TMST": "TMST", "UYST": "UYST", "MST": "MST", "BT": "BT", "NZDT": "NZDT", "EST": "EST", "MESZ": "MESZ", "WARST": "WARST", "CLT": "CLT", "BOT": "BOT", "PST": "PST", "SAST": "SAST", "MYT": "MYT", "HECU": "HECU", "AKST": "AKST", "HKT": "HKT", "HKST": "HKST", "WITA": "WITA", "SRT": "SRT", "ARST": "ARST", "CHAST": "CHAST", "ChST": "ChST", "MDT": "MDT", "WEZ": "WEZ", "JDT": "JDT", "ACWDT": "ACWDT", "LHST": "LHST", "EAT": "EAT", "HAST": "HAST", "CHADT": "CHADT"},
  67. }
  68. }
  69. // Locale returns the current translators string locale
  70. func (lag *lag_TZ) Locale() string {
  71. return lag.locale
  72. }
  73. // PluralsCardinal returns the list of cardinal plural rules associated with 'lag_TZ'
  74. func (lag *lag_TZ) PluralsCardinal() []locales.PluralRule {
  75. return lag.pluralsCardinal
  76. }
  77. // PluralsOrdinal returns the list of ordinal plural rules associated with 'lag_TZ'
  78. func (lag *lag_TZ) PluralsOrdinal() []locales.PluralRule {
  79. return lag.pluralsOrdinal
  80. }
  81. // PluralsRange returns the list of range plural rules associated with 'lag_TZ'
  82. func (lag *lag_TZ) PluralsRange() []locales.PluralRule {
  83. return lag.pluralsRange
  84. }
  85. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'lag_TZ'
  86. func (lag *lag_TZ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  87. n := math.Abs(num)
  88. i := int64(n)
  89. if n == 0 {
  90. return locales.PluralRuleZero
  91. } else if (i == 0 || i == 1) && n != 0 {
  92. return locales.PluralRuleOne
  93. }
  94. return locales.PluralRuleOther
  95. }
  96. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'lag_TZ'
  97. func (lag *lag_TZ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  98. return locales.PluralRuleUnknown
  99. }
  100. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'lag_TZ'
  101. func (lag *lag_TZ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  102. return locales.PluralRuleUnknown
  103. }
  104. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  105. func (lag *lag_TZ) MonthAbbreviated(month time.Month) string {
  106. return lag.monthsAbbreviated[month]
  107. }
  108. // MonthsAbbreviated returns the locales abbreviated months
  109. func (lag *lag_TZ) MonthsAbbreviated() []string {
  110. return lag.monthsAbbreviated[1:]
  111. }
  112. // MonthNarrow returns the locales narrow month given the 'month' provided
  113. func (lag *lag_TZ) MonthNarrow(month time.Month) string {
  114. return lag.monthsNarrow[month]
  115. }
  116. // MonthsNarrow returns the locales narrow months
  117. func (lag *lag_TZ) MonthsNarrow() []string {
  118. return lag.monthsNarrow[1:]
  119. }
  120. // MonthWide returns the locales wide month given the 'month' provided
  121. func (lag *lag_TZ) MonthWide(month time.Month) string {
  122. return lag.monthsWide[month]
  123. }
  124. // MonthsWide returns the locales wide months
  125. func (lag *lag_TZ) MonthsWide() []string {
  126. return lag.monthsWide[1:]
  127. }
  128. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  129. func (lag *lag_TZ) WeekdayAbbreviated(weekday time.Weekday) string {
  130. return lag.daysAbbreviated[weekday]
  131. }
  132. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  133. func (lag *lag_TZ) WeekdaysAbbreviated() []string {
  134. return lag.daysAbbreviated
  135. }
  136. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  137. func (lag *lag_TZ) WeekdayNarrow(weekday time.Weekday) string {
  138. return lag.daysNarrow[weekday]
  139. }
  140. // WeekdaysNarrow returns the locales narrow weekdays
  141. func (lag *lag_TZ) WeekdaysNarrow() []string {
  142. return lag.daysNarrow
  143. }
  144. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  145. func (lag *lag_TZ) WeekdayShort(weekday time.Weekday) string {
  146. return lag.daysShort[weekday]
  147. }
  148. // WeekdaysShort returns the locales short weekdays
  149. func (lag *lag_TZ) WeekdaysShort() []string {
  150. return lag.daysShort
  151. }
  152. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  153. func (lag *lag_TZ) WeekdayWide(weekday time.Weekday) string {
  154. return lag.daysWide[weekday]
  155. }
  156. // WeekdaysWide returns the locales wide weekdays
  157. func (lag *lag_TZ) WeekdaysWide() []string {
  158. return lag.daysWide
  159. }
  160. // Decimal returns the decimal point of number
  161. func (lag *lag_TZ) Decimal() string {
  162. return lag.decimal
  163. }
  164. // Group returns the group of number
  165. func (lag *lag_TZ) Group() string {
  166. return lag.group
  167. }
  168. // Group returns the minus sign of number
  169. func (lag *lag_TZ) Minus() string {
  170. return lag.minus
  171. }
  172. // FmtNumber returns 'num' with digits/precision of 'v' for 'lag_TZ' and handles both Whole and Real numbers based on 'v'
  173. func (lag *lag_TZ) FmtNumber(num float64, v uint64) string {
  174. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  175. }
  176. // FmtPercent returns 'num' with digits/precision of 'v' for 'lag_TZ' and handles both Whole and Real numbers based on 'v'
  177. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  178. func (lag *lag_TZ) FmtPercent(num float64, v uint64) string {
  179. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  180. }
  181. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'lag_TZ'
  182. func (lag *lag_TZ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  183. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  184. symbol := lag.currencies[currency]
  185. l := len(s) + len(symbol) + 3
  186. b := make([]byte, 0, l)
  187. for i := len(s) - 1; i >= 0; i-- {
  188. if s[i] == '.' {
  189. b = append(b, lag.decimal[0])
  190. continue
  191. }
  192. b = append(b, s[i])
  193. }
  194. for j := len(symbol) - 1; j >= 0; j-- {
  195. b = append(b, symbol[j])
  196. }
  197. for j := len(lag.currencyPositivePrefix) - 1; j >= 0; j-- {
  198. b = append(b, lag.currencyPositivePrefix[j])
  199. }
  200. if num < 0 {
  201. b = append(b, lag.minus[0])
  202. }
  203. // reverse
  204. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  205. b[i], b[j] = b[j], b[i]
  206. }
  207. b = append(b, lag.currencyPositiveSuffix...)
  208. return string(b)
  209. }
  210. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'lag_TZ'
  211. // in accounting notation.
  212. func (lag *lag_TZ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  213. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  214. symbol := lag.currencies[currency]
  215. l := len(s) + len(symbol) + 3
  216. b := make([]byte, 0, l)
  217. for i := len(s) - 1; i >= 0; i-- {
  218. if s[i] == '.' {
  219. b = append(b, lag.decimal[0])
  220. continue
  221. }
  222. b = append(b, s[i])
  223. }
  224. if num < 0 {
  225. for j := len(symbol) - 1; j >= 0; j-- {
  226. b = append(b, symbol[j])
  227. }
  228. for j := len(lag.currencyNegativePrefix) - 1; j >= 0; j-- {
  229. b = append(b, lag.currencyNegativePrefix[j])
  230. }
  231. b = append(b, lag.minus[0])
  232. } else {
  233. for j := len(symbol) - 1; j >= 0; j-- {
  234. b = append(b, symbol[j])
  235. }
  236. for j := len(lag.currencyPositivePrefix) - 1; j >= 0; j-- {
  237. b = append(b, lag.currencyPositivePrefix[j])
  238. }
  239. }
  240. // reverse
  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. if num < 0 {
  245. b = append(b, lag.currencyNegativeSuffix...)
  246. } else {
  247. b = append(b, lag.currencyPositiveSuffix...)
  248. }
  249. return string(b)
  250. }
  251. // FmtDateShort returns the short date representation of 't' for 'lag_TZ'
  252. func (lag *lag_TZ) FmtDateShort(t time.Time) string {
  253. b := make([]byte, 0, 32)
  254. if t.Day() < 10 {
  255. b = append(b, '0')
  256. }
  257. b = strconv.AppendInt(b, int64(t.Day()), 10)
  258. b = append(b, []byte{0x2f}...)
  259. if t.Month() < 10 {
  260. b = append(b, '0')
  261. }
  262. b = strconv.AppendInt(b, int64(t.Month()), 10)
  263. b = append(b, []byte{0x2f}...)
  264. if t.Year() > 0 {
  265. b = strconv.AppendInt(b, int64(t.Year()), 10)
  266. } else {
  267. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  268. }
  269. return string(b)
  270. }
  271. // FmtDateMedium returns the medium date representation of 't' for 'lag_TZ'
  272. func (lag *lag_TZ) FmtDateMedium(t time.Time) string {
  273. b := make([]byte, 0, 32)
  274. b = strconv.AppendInt(b, int64(t.Day()), 10)
  275. b = append(b, []byte{0x20}...)
  276. b = append(b, lag.monthsAbbreviated[t.Month()]...)
  277. b = append(b, []byte{0x20}...)
  278. if t.Year() > 0 {
  279. b = strconv.AppendInt(b, int64(t.Year()), 10)
  280. } else {
  281. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  282. }
  283. return string(b)
  284. }
  285. // FmtDateLong returns the long date representation of 't' for 'lag_TZ'
  286. func (lag *lag_TZ) FmtDateLong(t time.Time) string {
  287. b := make([]byte, 0, 32)
  288. b = strconv.AppendInt(b, int64(t.Day()), 10)
  289. b = append(b, []byte{0x20}...)
  290. b = append(b, lag.monthsWide[t.Month()]...)
  291. b = append(b, []byte{0x20}...)
  292. if t.Year() > 0 {
  293. b = strconv.AppendInt(b, int64(t.Year()), 10)
  294. } else {
  295. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  296. }
  297. return string(b)
  298. }
  299. // FmtDateFull returns the full date representation of 't' for 'lag_TZ'
  300. func (lag *lag_TZ) FmtDateFull(t time.Time) string {
  301. b := make([]byte, 0, 32)
  302. b = append(b, lag.daysWide[t.Weekday()]...)
  303. b = append(b, []byte{0x2c, 0x20}...)
  304. b = strconv.AppendInt(b, int64(t.Day()), 10)
  305. b = append(b, []byte{0x20}...)
  306. b = append(b, lag.monthsWide[t.Month()]...)
  307. b = append(b, []byte{0x20}...)
  308. if t.Year() > 0 {
  309. b = strconv.AppendInt(b, int64(t.Year()), 10)
  310. } else {
  311. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  312. }
  313. return string(b)
  314. }
  315. // FmtTimeShort returns the short time representation of 't' for 'lag_TZ'
  316. func (lag *lag_TZ) FmtTimeShort(t time.Time) string {
  317. b := make([]byte, 0, 32)
  318. if t.Hour() < 10 {
  319. b = append(b, '0')
  320. }
  321. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  322. b = append(b, lag.timeSeparator...)
  323. if t.Minute() < 10 {
  324. b = append(b, '0')
  325. }
  326. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  327. return string(b)
  328. }
  329. // FmtTimeMedium returns the medium time representation of 't' for 'lag_TZ'
  330. func (lag *lag_TZ) FmtTimeMedium(t time.Time) string {
  331. b := make([]byte, 0, 32)
  332. if t.Hour() < 10 {
  333. b = append(b, '0')
  334. }
  335. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  336. b = append(b, lag.timeSeparator...)
  337. if t.Minute() < 10 {
  338. b = append(b, '0')
  339. }
  340. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  341. b = append(b, lag.timeSeparator...)
  342. if t.Second() < 10 {
  343. b = append(b, '0')
  344. }
  345. b = strconv.AppendInt(b, int64(t.Second()), 10)
  346. return string(b)
  347. }
  348. // FmtTimeLong returns the long time representation of 't' for 'lag_TZ'
  349. func (lag *lag_TZ) FmtTimeLong(t time.Time) string {
  350. b := make([]byte, 0, 32)
  351. if t.Hour() < 10 {
  352. b = append(b, '0')
  353. }
  354. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  355. b = append(b, lag.timeSeparator...)
  356. if t.Minute() < 10 {
  357. b = append(b, '0')
  358. }
  359. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  360. b = append(b, lag.timeSeparator...)
  361. if t.Second() < 10 {
  362. b = append(b, '0')
  363. }
  364. b = strconv.AppendInt(b, int64(t.Second()), 10)
  365. b = append(b, []byte{0x20}...)
  366. tz, _ := t.Zone()
  367. b = append(b, tz...)
  368. return string(b)
  369. }
  370. // FmtTimeFull returns the full time representation of 't' for 'lag_TZ'
  371. func (lag *lag_TZ) FmtTimeFull(t time.Time) string {
  372. b := make([]byte, 0, 32)
  373. if t.Hour() < 10 {
  374. b = append(b, '0')
  375. }
  376. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  377. b = append(b, lag.timeSeparator...)
  378. if t.Minute() < 10 {
  379. b = append(b, '0')
  380. }
  381. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  382. b = append(b, lag.timeSeparator...)
  383. if t.Second() < 10 {
  384. b = append(b, '0')
  385. }
  386. b = strconv.AppendInt(b, int64(t.Second()), 10)
  387. b = append(b, []byte{0x20}...)
  388. tz, _ := t.Zone()
  389. if btz, ok := lag.timezones[tz]; ok {
  390. b = append(b, btz...)
  391. } else {
  392. b = append(b, tz...)
  393. }
  394. return string(b)
  395. }