...

Source file src/github.com/go-playground/locales/khq/khq.go

Documentation: github.com/go-playground/locales/khq

     1  package khq
     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 khq 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 // idx = enum of currency code
    25  	monthsAbbreviated  []string
    26  	monthsNarrow       []string
    27  	monthsWide         []string
    28  	daysAbbreviated    []string
    29  	daysNarrow         []string
    30  	daysShort          []string
    31  	daysWide           []string
    32  	periodsAbbreviated []string
    33  	periodsNarrow      []string
    34  	periodsShort       []string
    35  	periodsWide        []string
    36  	erasAbbreviated    []string
    37  	erasNarrow         []string
    38  	erasWide           []string
    39  	timezones          map[string]string
    40  }
    41  
    42  // New returns a new instance of translator for the 'khq' locale
    43  func New() locales.Translator {
    44  	return &khq{
    45  		locale:             "khq",
    46  		pluralsCardinal:    nil,
    47  		pluralsOrdinal:     nil,
    48  		pluralsRange:       nil,
    49  		group:              " ",
    50  		timeSeparator:      ":",
    51  		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"},
    52  		monthsAbbreviated:  []string{"", "Žan", "Fee", "Mar", "Awi", "Me", "Žuw", "Žuy", "Ut", "Sek", "Okt", "Noo", "Dee"},
    53  		monthsNarrow:       []string{"", "Ž", "F", "M", "A", "M", "Ž", "Ž", "U", "S", "O", "N", "D"},
    54  		monthsWide:         []string{"", "Žanwiye", "Feewiriye", "Marsi", "Awiril", "Me", "Žuweŋ", "Žuyye", "Ut", "Sektanbur", "Oktoobur", "Noowanbur", "Deesanbur"},
    55  		daysAbbreviated:    []string{"Alh", "Ati", "Ata", "Ala", "Alm", "Alj", "Ass"},
    56  		daysNarrow:         []string{"H", "T", "T", "L", "L", "L", "S"},
    57  		daysWide:           []string{"Alhadi", "Atini", "Atalata", "Alarba", "Alhamiisa", "Aljuma", "Assabdu"},
    58  		periodsAbbreviated: []string{"Adduha", "Aluula"},
    59  		periodsWide:        []string{"Adduha", "Aluula"},
    60  		erasAbbreviated:    []string{"IJ", "IZ"},
    61  		erasNarrow:         []string{"", ""},
    62  		erasWide:           []string{"Isaa jine", "Isaa jamanoo"},
    63  		timezones:          map[string]string{"ACDT": "ACDT", "ACST": "ACST", "ACWDT": "ACWDT", "ACWST": "ACWST", "ADT": "ADT", "AEDT": "AEDT", "AEST": "AEST", "AKDT": "AKDT", "AKST": "AKST", "ARST": "ARST", "ART": "ART", "AST": "AST", "AWDT": "AWDT", "AWST": "AWST", "BOT": "BOT", "BT": "BT", "CAT": "CAT", "CDT": "CDT", "CHADT": "CHADT", "CHAST": "CHAST", "CLST": "CLST", "CLT": "CLT", "COST": "COST", "COT": "COT", "CST": "CST", "ChST": "ChST", "EAT": "EAT", "ECT": "ECT", "EDT": "EDT", "EST": "EST", "GFT": "GFT", "GMT": "GMT", "GST": "GST", "GYT": "GYT", "HADT": "HADT", "HAST": "HAST", "HAT": "HAT", "HECU": "HECU", "HEEG": "HEEG", "HENOMX": "HENOMX", "HEOG": "HEOG", "HEPM": "HEPM", "HEPMX": "HEPMX", "HKST": "HKST", "HKT": "HKT", "HNCU": "HNCU", "HNEG": "HNEG", "HNNOMX": "HNNOMX", "HNOG": "HNOG", "HNPM": "HNPM", "HNPMX": "HNPMX", "HNT": "HNT", "IST": "IST", "JDT": "JDT", "JST": "JST", "LHDT": "LHDT", "LHST": "LHST", "MDT": "MDT", "MESZ": "MESZ", "MEZ": "MEZ", "MST": "MST", "MYT": "MYT", "NZDT": "NZDT", "NZST": "NZST", "OESZ": "OESZ", "OEZ": "OEZ", "PDT": "PDT", "PST": "PST", "SAST": "SAST", "SGT": "SGT", "SRT": "SRT", "TMST": "TMST", "TMT": "TMT", "UYST": "UYST", "UYT": "UYT", "VET": "VET", "WARST": "WARST", "WART": "WART", "WAST": "WAST", "WAT": "WAT", "WESZ": "WESZ", "WEZ": "WEZ", "WIB": "WIB", "WIT": "WIT", "WITA": "WITA", "∅∅∅": "∅∅∅"},
    64  	}
    65  }
    66  
    67  // Locale returns the current translators string locale
    68  func (khq *khq) Locale() string {
    69  	return khq.locale
    70  }
    71  
    72  // PluralsCardinal returns the list of cardinal plural rules associated with 'khq'
    73  func (khq *khq) PluralsCardinal() []locales.PluralRule {
    74  	return khq.pluralsCardinal
    75  }
    76  
    77  // PluralsOrdinal returns the list of ordinal plural rules associated with 'khq'
    78  func (khq *khq) PluralsOrdinal() []locales.PluralRule {
    79  	return khq.pluralsOrdinal
    80  }
    81  
    82  // PluralsRange returns the list of range plural rules associated with 'khq'
    83  func (khq *khq) PluralsRange() []locales.PluralRule {
    84  	return khq.pluralsRange
    85  }
    86  
    87  // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'khq'
    88  func (khq *khq) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
    89  	return locales.PluralRuleUnknown
    90  }
    91  
    92  // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'khq'
    93  func (khq *khq) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
    94  	return locales.PluralRuleUnknown
    95  }
    96  
    97  // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'khq'
    98  func (khq *khq) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
    99  	return locales.PluralRuleUnknown
   100  }
   101  
   102  // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
   103  func (khq *khq) MonthAbbreviated(month time.Month) string {
   104  	return khq.monthsAbbreviated[month]
   105  }
   106  
   107  // MonthsAbbreviated returns the locales abbreviated months
   108  func (khq *khq) MonthsAbbreviated() []string {
   109  	return khq.monthsAbbreviated[1:]
   110  }
   111  
   112  // MonthNarrow returns the locales narrow month given the 'month' provided
   113  func (khq *khq) MonthNarrow(month time.Month) string {
   114  	return khq.monthsNarrow[month]
   115  }
   116  
   117  // MonthsNarrow returns the locales narrow months
   118  func (khq *khq) MonthsNarrow() []string {
   119  	return khq.monthsNarrow[1:]
   120  }
   121  
   122  // MonthWide returns the locales wide month given the 'month' provided
   123  func (khq *khq) MonthWide(month time.Month) string {
   124  	return khq.monthsWide[month]
   125  }
   126  
   127  // MonthsWide returns the locales wide months
   128  func (khq *khq) MonthsWide() []string {
   129  	return khq.monthsWide[1:]
   130  }
   131  
   132  // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
   133  func (khq *khq) WeekdayAbbreviated(weekday time.Weekday) string {
   134  	return khq.daysAbbreviated[weekday]
   135  }
   136  
   137  // WeekdaysAbbreviated returns the locales abbreviated weekdays
   138  func (khq *khq) WeekdaysAbbreviated() []string {
   139  	return khq.daysAbbreviated
   140  }
   141  
   142  // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
   143  func (khq *khq) WeekdayNarrow(weekday time.Weekday) string {
   144  	return khq.daysNarrow[weekday]
   145  }
   146  
   147  // WeekdaysNarrow returns the locales narrow weekdays
   148  func (khq *khq) WeekdaysNarrow() []string {
   149  	return khq.daysNarrow
   150  }
   151  
   152  // WeekdayShort returns the locales short weekday given the 'weekday' provided
   153  func (khq *khq) WeekdayShort(weekday time.Weekday) string {
   154  	return khq.daysShort[weekday]
   155  }
   156  
   157  // WeekdaysShort returns the locales short weekdays
   158  func (khq *khq) WeekdaysShort() []string {
   159  	return khq.daysShort
   160  }
   161  
   162  // WeekdayWide returns the locales wide weekday given the 'weekday' provided
   163  func (khq *khq) WeekdayWide(weekday time.Weekday) string {
   164  	return khq.daysWide[weekday]
   165  }
   166  
   167  // WeekdaysWide returns the locales wide weekdays
   168  func (khq *khq) WeekdaysWide() []string {
   169  	return khq.daysWide
   170  }
   171  
   172  // Decimal returns the decimal point of number
   173  func (khq *khq) Decimal() string {
   174  	return khq.decimal
   175  }
   176  
   177  // Group returns the group of number
   178  func (khq *khq) Group() string {
   179  	return khq.group
   180  }
   181  
   182  // Group returns the minus sign of number
   183  func (khq *khq) Minus() string {
   184  	return khq.minus
   185  }
   186  
   187  // FmtNumber returns 'num' with digits/precision of 'v' for 'khq' and handles both Whole and Real numbers based on 'v'
   188  func (khq *khq) FmtNumber(num float64, v uint64) string {
   189  
   190  	return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   191  }
   192  
   193  // FmtPercent returns 'num' with digits/precision of 'v' for 'khq' and handles both Whole and Real numbers based on 'v'
   194  // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
   195  func (khq *khq) FmtPercent(num float64, v uint64) string {
   196  	return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   197  }
   198  
   199  // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'khq'
   200  func (khq *khq) FmtCurrency(num float64, v uint64, currency currency.Type) string {
   201  
   202  	s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   203  	symbol := khq.currencies[currency]
   204  	l := len(s) + len(symbol) + 0 + 2*len(s[:len(s)-int(v)-1])/3
   205  	count := 0
   206  	inWhole := v == 0
   207  	b := make([]byte, 0, l)
   208  
   209  	for i := len(s) - 1; i >= 0; i-- {
   210  
   211  		if s[i] == '.' {
   212  			b = append(b, khq.decimal[0])
   213  			inWhole = true
   214  			continue
   215  		}
   216  
   217  		if inWhole {
   218  			if count == 3 {
   219  				for j := len(khq.group) - 1; j >= 0; j-- {
   220  					b = append(b, khq.group[j])
   221  				}
   222  				count = 1
   223  			} else {
   224  				count++
   225  			}
   226  		}
   227  
   228  		b = append(b, s[i])
   229  	}
   230  
   231  	if num < 0 {
   232  		b = append(b, khq.minus[0])
   233  	}
   234  
   235  	// reverse
   236  	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
   237  		b[i], b[j] = b[j], b[i]
   238  	}
   239  
   240  	if int(v) < 2 {
   241  
   242  		if v == 0 {
   243  			b = append(b, khq.decimal...)
   244  		}
   245  
   246  		for i := 0; i < 2-int(v); i++ {
   247  			b = append(b, '0')
   248  		}
   249  	}
   250  
   251  	b = append(b, symbol...)
   252  
   253  	return string(b)
   254  }
   255  
   256  // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'khq'
   257  // in accounting notation.
   258  func (khq *khq) FmtAccounting(num float64, v uint64, currency currency.Type) string {
   259  
   260  	s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   261  	symbol := khq.currencies[currency]
   262  	l := len(s) + len(symbol) + 0 + 2*len(s[:len(s)-int(v)-1])/3
   263  	count := 0
   264  	inWhole := v == 0
   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, khq.decimal[0])
   271  			inWhole = true
   272  			continue
   273  		}
   274  
   275  		if inWhole {
   276  			if count == 3 {
   277  				for j := len(khq.group) - 1; j >= 0; j-- {
   278  					b = append(b, khq.group[j])
   279  				}
   280  				count = 1
   281  			} else {
   282  				count++
   283  			}
   284  		}
   285  
   286  		b = append(b, s[i])
   287  	}
   288  
   289  	if num < 0 {
   290  
   291  		b = append(b, khq.minus[0])
   292  
   293  	}
   294  
   295  	// reverse
   296  	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
   297  		b[i], b[j] = b[j], b[i]
   298  	}
   299  
   300  	if int(v) < 2 {
   301  
   302  		if v == 0 {
   303  			b = append(b, khq.decimal...)
   304  		}
   305  
   306  		for i := 0; i < 2-int(v); i++ {
   307  			b = append(b, '0')
   308  		}
   309  	}
   310  
   311  	if num < 0 {
   312  		b = append(b, symbol...)
   313  	} else {
   314  
   315  		b = append(b, symbol...)
   316  	}
   317  
   318  	return string(b)
   319  }
   320  
   321  // FmtDateShort returns the short date representation of 't' for 'khq'
   322  func (khq *khq) FmtDateShort(t time.Time) string {
   323  
   324  	b := make([]byte, 0, 32)
   325  
   326  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   327  	b = append(b, []byte{0x2f}...)
   328  	b = strconv.AppendInt(b, int64(t.Month()), 10)
   329  	b = append(b, []byte{0x2f}...)
   330  
   331  	if t.Year() > 0 {
   332  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   333  	} else {
   334  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   335  	}
   336  
   337  	return string(b)
   338  }
   339  
   340  // FmtDateMedium returns the medium date representation of 't' for 'khq'
   341  func (khq *khq) FmtDateMedium(t time.Time) string {
   342  
   343  	b := make([]byte, 0, 32)
   344  
   345  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   346  	b = append(b, []byte{0x20}...)
   347  	b = append(b, khq.monthsAbbreviated[t.Month()]...)
   348  	b = append(b, []byte{0x2c, 0x20}...)
   349  
   350  	if t.Year() > 0 {
   351  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   352  	} else {
   353  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   354  	}
   355  
   356  	return string(b)
   357  }
   358  
   359  // FmtDateLong returns the long date representation of 't' for 'khq'
   360  func (khq *khq) FmtDateLong(t time.Time) string {
   361  
   362  	b := make([]byte, 0, 32)
   363  
   364  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   365  	b = append(b, []byte{0x20}...)
   366  	b = append(b, khq.monthsWide[t.Month()]...)
   367  	b = append(b, []byte{0x20}...)
   368  
   369  	if t.Year() > 0 {
   370  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   371  	} else {
   372  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   373  	}
   374  
   375  	return string(b)
   376  }
   377  
   378  // FmtDateFull returns the full date representation of 't' for 'khq'
   379  func (khq *khq) FmtDateFull(t time.Time) string {
   380  
   381  	b := make([]byte, 0, 32)
   382  
   383  	b = append(b, khq.daysWide[t.Weekday()]...)
   384  	b = append(b, []byte{0x20}...)
   385  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   386  	b = append(b, []byte{0x20}...)
   387  	b = append(b, khq.monthsWide[t.Month()]...)
   388  	b = append(b, []byte{0x20}...)
   389  
   390  	if t.Year() > 0 {
   391  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   392  	} else {
   393  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   394  	}
   395  
   396  	return string(b)
   397  }
   398  
   399  // FmtTimeShort returns the short time representation of 't' for 'khq'
   400  func (khq *khq) FmtTimeShort(t time.Time) string {
   401  
   402  	b := make([]byte, 0, 32)
   403  
   404  	if t.Hour() < 10 {
   405  		b = append(b, '0')
   406  	}
   407  
   408  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   409  	b = append(b, khq.timeSeparator...)
   410  
   411  	if t.Minute() < 10 {
   412  		b = append(b, '0')
   413  	}
   414  
   415  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   416  
   417  	return string(b)
   418  }
   419  
   420  // FmtTimeMedium returns the medium time representation of 't' for 'khq'
   421  func (khq *khq) FmtTimeMedium(t time.Time) string {
   422  
   423  	b := make([]byte, 0, 32)
   424  
   425  	if t.Hour() < 10 {
   426  		b = append(b, '0')
   427  	}
   428  
   429  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   430  	b = append(b, khq.timeSeparator...)
   431  
   432  	if t.Minute() < 10 {
   433  		b = append(b, '0')
   434  	}
   435  
   436  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   437  	b = append(b, khq.timeSeparator...)
   438  
   439  	if t.Second() < 10 {
   440  		b = append(b, '0')
   441  	}
   442  
   443  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   444  
   445  	return string(b)
   446  }
   447  
   448  // FmtTimeLong returns the long time representation of 't' for 'khq'
   449  func (khq *khq) FmtTimeLong(t time.Time) string {
   450  
   451  	b := make([]byte, 0, 32)
   452  
   453  	if t.Hour() < 10 {
   454  		b = append(b, '0')
   455  	}
   456  
   457  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   458  	b = append(b, khq.timeSeparator...)
   459  
   460  	if t.Minute() < 10 {
   461  		b = append(b, '0')
   462  	}
   463  
   464  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   465  	b = append(b, khq.timeSeparator...)
   466  
   467  	if t.Second() < 10 {
   468  		b = append(b, '0')
   469  	}
   470  
   471  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   472  	b = append(b, []byte{0x20}...)
   473  
   474  	tz, _ := t.Zone()
   475  	b = append(b, tz...)
   476  
   477  	return string(b)
   478  }
   479  
   480  // FmtTimeFull returns the full time representation of 't' for 'khq'
   481  func (khq *khq) FmtTimeFull(t time.Time) string {
   482  
   483  	b := make([]byte, 0, 32)
   484  
   485  	if t.Hour() < 10 {
   486  		b = append(b, '0')
   487  	}
   488  
   489  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   490  	b = append(b, khq.timeSeparator...)
   491  
   492  	if t.Minute() < 10 {
   493  		b = append(b, '0')
   494  	}
   495  
   496  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   497  	b = append(b, khq.timeSeparator...)
   498  
   499  	if t.Second() < 10 {
   500  		b = append(b, '0')
   501  	}
   502  
   503  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   504  	b = append(b, []byte{0x20}...)
   505  
   506  	tz, _ := t.Zone()
   507  
   508  	if btz, ok := khq.timezones[tz]; ok {
   509  		b = append(b, btz...)
   510  	} else {
   511  		b = append(b, tz...)
   512  	}
   513  
   514  	return string(b)
   515  }
   516  

View as plain text