...

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

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

     1  package ksb_TZ
     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 ksb_TZ 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 'ksb_TZ' locale
    43  func New() locales.Translator {
    44  	return &ksb_TZ{
    45  		locale:             "ksb_TZ",
    46  		pluralsCardinal:    []locales.PluralRule{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", "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"},
    51  		monthsAbbreviated:  []string{"", "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des"},
    52  		monthsNarrow:       []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
    53  		monthsWide:         []string{"", "Januali", "Febluali", "Machi", "Aplili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba"},
    54  		daysAbbreviated:    []string{"Jpi", "Jtt", "Jmn", "Jtn", "Alh", "Iju", "Jmo"},
    55  		daysNarrow:         []string{"2", "3", "4", "5", "A", "I", "1"},
    56  		daysWide:           []string{"Jumaapii", "Jumaatatu", "Jumaane", "Jumaatano", "Alhamisi", "Ijumaa", "Jumaamosi"},
    57  		periodsAbbreviated: []string{"makeo", "nyiaghuo"},
    58  		periodsWide:        []string{"makeo", "nyiaghuo"},
    59  		erasAbbreviated:    []string{"KK", "BK"},
    60  		erasNarrow:         []string{"", ""},
    61  		erasWide:           []string{"Kabla ya Klisto", "Baada ya Klisto"},
    62  		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", "∅∅∅": "∅∅∅"},
    63  	}
    64  }
    65  
    66  // Locale returns the current translators string locale
    67  func (ksb *ksb_TZ) Locale() string {
    68  	return ksb.locale
    69  }
    70  
    71  // PluralsCardinal returns the list of cardinal plural rules associated with 'ksb_TZ'
    72  func (ksb *ksb_TZ) PluralsCardinal() []locales.PluralRule {
    73  	return ksb.pluralsCardinal
    74  }
    75  
    76  // PluralsOrdinal returns the list of ordinal plural rules associated with 'ksb_TZ'
    77  func (ksb *ksb_TZ) PluralsOrdinal() []locales.PluralRule {
    78  	return ksb.pluralsOrdinal
    79  }
    80  
    81  // PluralsRange returns the list of range plural rules associated with 'ksb_TZ'
    82  func (ksb *ksb_TZ) PluralsRange() []locales.PluralRule {
    83  	return ksb.pluralsRange
    84  }
    85  
    86  // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ksb_TZ'
    87  func (ksb *ksb_TZ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
    88  
    89  	n := math.Abs(num)
    90  
    91  	if n == 1 {
    92  		return locales.PluralRuleOne
    93  	}
    94  
    95  	return locales.PluralRuleOther
    96  }
    97  
    98  // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ksb_TZ'
    99  func (ksb *ksb_TZ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
   100  	return locales.PluralRuleUnknown
   101  }
   102  
   103  // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ksb_TZ'
   104  func (ksb *ksb_TZ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
   105  	return locales.PluralRuleUnknown
   106  }
   107  
   108  // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
   109  func (ksb *ksb_TZ) MonthAbbreviated(month time.Month) string {
   110  	return ksb.monthsAbbreviated[month]
   111  }
   112  
   113  // MonthsAbbreviated returns the locales abbreviated months
   114  func (ksb *ksb_TZ) MonthsAbbreviated() []string {
   115  	return ksb.monthsAbbreviated[1:]
   116  }
   117  
   118  // MonthNarrow returns the locales narrow month given the 'month' provided
   119  func (ksb *ksb_TZ) MonthNarrow(month time.Month) string {
   120  	return ksb.monthsNarrow[month]
   121  }
   122  
   123  // MonthsNarrow returns the locales narrow months
   124  func (ksb *ksb_TZ) MonthsNarrow() []string {
   125  	return ksb.monthsNarrow[1:]
   126  }
   127  
   128  // MonthWide returns the locales wide month given the 'month' provided
   129  func (ksb *ksb_TZ) MonthWide(month time.Month) string {
   130  	return ksb.monthsWide[month]
   131  }
   132  
   133  // MonthsWide returns the locales wide months
   134  func (ksb *ksb_TZ) MonthsWide() []string {
   135  	return ksb.monthsWide[1:]
   136  }
   137  
   138  // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
   139  func (ksb *ksb_TZ) WeekdayAbbreviated(weekday time.Weekday) string {
   140  	return ksb.daysAbbreviated[weekday]
   141  }
   142  
   143  // WeekdaysAbbreviated returns the locales abbreviated weekdays
   144  func (ksb *ksb_TZ) WeekdaysAbbreviated() []string {
   145  	return ksb.daysAbbreviated
   146  }
   147  
   148  // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
   149  func (ksb *ksb_TZ) WeekdayNarrow(weekday time.Weekday) string {
   150  	return ksb.daysNarrow[weekday]
   151  }
   152  
   153  // WeekdaysNarrow returns the locales narrow weekdays
   154  func (ksb *ksb_TZ) WeekdaysNarrow() []string {
   155  	return ksb.daysNarrow
   156  }
   157  
   158  // WeekdayShort returns the locales short weekday given the 'weekday' provided
   159  func (ksb *ksb_TZ) WeekdayShort(weekday time.Weekday) string {
   160  	return ksb.daysShort[weekday]
   161  }
   162  
   163  // WeekdaysShort returns the locales short weekdays
   164  func (ksb *ksb_TZ) WeekdaysShort() []string {
   165  	return ksb.daysShort
   166  }
   167  
   168  // WeekdayWide returns the locales wide weekday given the 'weekday' provided
   169  func (ksb *ksb_TZ) WeekdayWide(weekday time.Weekday) string {
   170  	return ksb.daysWide[weekday]
   171  }
   172  
   173  // WeekdaysWide returns the locales wide weekdays
   174  func (ksb *ksb_TZ) WeekdaysWide() []string {
   175  	return ksb.daysWide
   176  }
   177  
   178  // Decimal returns the decimal point of number
   179  func (ksb *ksb_TZ) Decimal() string {
   180  	return ksb.decimal
   181  }
   182  
   183  // Group returns the group of number
   184  func (ksb *ksb_TZ) Group() string {
   185  	return ksb.group
   186  }
   187  
   188  // Group returns the minus sign of number
   189  func (ksb *ksb_TZ) Minus() string {
   190  	return ksb.minus
   191  }
   192  
   193  // FmtNumber returns 'num' with digits/precision of 'v' for 'ksb_TZ' and handles both Whole and Real numbers based on 'v'
   194  func (ksb *ksb_TZ) FmtNumber(num float64, v uint64) string {
   195  
   196  	return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   197  }
   198  
   199  // FmtPercent returns 'num' with digits/precision of 'v' for 'ksb_TZ' and handles both Whole and Real numbers based on 'v'
   200  // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
   201  func (ksb *ksb_TZ) FmtPercent(num float64, v uint64) string {
   202  	return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   203  }
   204  
   205  // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ksb_TZ'
   206  func (ksb *ksb_TZ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
   207  
   208  	s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   209  	symbol := ksb.currencies[currency]
   210  	l := len(s) + len(symbol) + 0
   211  	count := 0
   212  	inWhole := v == 0
   213  	b := make([]byte, 0, l)
   214  
   215  	for i := len(s) - 1; i >= 0; i-- {
   216  
   217  		if s[i] == '.' {
   218  			b = append(b, ksb.decimal[0])
   219  			inWhole = true
   220  			continue
   221  		}
   222  
   223  		if inWhole {
   224  			if count == 3 {
   225  				b = append(b, ksb.group[0])
   226  				count = 1
   227  			} else {
   228  				count++
   229  			}
   230  		}
   231  
   232  		b = append(b, s[i])
   233  	}
   234  
   235  	if num < 0 {
   236  		b = append(b, ksb.minus[0])
   237  	}
   238  
   239  	// reverse
   240  	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
   241  		b[i], b[j] = b[j], b[i]
   242  	}
   243  
   244  	if int(v) < 2 {
   245  
   246  		if v == 0 {
   247  			b = append(b, ksb.decimal...)
   248  		}
   249  
   250  		for i := 0; i < 2-int(v); i++ {
   251  			b = append(b, '0')
   252  		}
   253  	}
   254  
   255  	b = append(b, symbol...)
   256  
   257  	return string(b)
   258  }
   259  
   260  // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ksb_TZ'
   261  // in accounting notation.
   262  func (ksb *ksb_TZ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
   263  
   264  	s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   265  	symbol := ksb.currencies[currency]
   266  	l := len(s) + len(symbol) + 0
   267  	count := 0
   268  	inWhole := v == 0
   269  	b := make([]byte, 0, l)
   270  
   271  	for i := len(s) - 1; i >= 0; i-- {
   272  
   273  		if s[i] == '.' {
   274  			b = append(b, ksb.decimal[0])
   275  			inWhole = true
   276  			continue
   277  		}
   278  
   279  		if inWhole {
   280  			if count == 3 {
   281  				b = append(b, ksb.group[0])
   282  				count = 1
   283  			} else {
   284  				count++
   285  			}
   286  		}
   287  
   288  		b = append(b, s[i])
   289  	}
   290  
   291  	if num < 0 {
   292  
   293  		b = append(b, ksb.minus[0])
   294  
   295  	}
   296  
   297  	// reverse
   298  	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
   299  		b[i], b[j] = b[j], b[i]
   300  	}
   301  
   302  	if int(v) < 2 {
   303  
   304  		if v == 0 {
   305  			b = append(b, ksb.decimal...)
   306  		}
   307  
   308  		for i := 0; i < 2-int(v); i++ {
   309  			b = append(b, '0')
   310  		}
   311  	}
   312  
   313  	if num < 0 {
   314  		b = append(b, symbol...)
   315  	} else {
   316  
   317  		b = append(b, symbol...)
   318  	}
   319  
   320  	return string(b)
   321  }
   322  
   323  // FmtDateShort returns the short date representation of 't' for 'ksb_TZ'
   324  func (ksb *ksb_TZ) FmtDateShort(t time.Time) string {
   325  
   326  	b := make([]byte, 0, 32)
   327  
   328  	if t.Day() < 10 {
   329  		b = append(b, '0')
   330  	}
   331  
   332  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   333  	b = append(b, []byte{0x2f}...)
   334  
   335  	if t.Month() < 10 {
   336  		b = append(b, '0')
   337  	}
   338  
   339  	b = strconv.AppendInt(b, int64(t.Month()), 10)
   340  
   341  	b = append(b, []byte{0x2f}...)
   342  
   343  	if t.Year() > 0 {
   344  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   345  	} else {
   346  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   347  	}
   348  
   349  	return string(b)
   350  }
   351  
   352  // FmtDateMedium returns the medium date representation of 't' for 'ksb_TZ'
   353  func (ksb *ksb_TZ) FmtDateMedium(t time.Time) string {
   354  
   355  	b := make([]byte, 0, 32)
   356  
   357  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   358  	b = append(b, []byte{0x20}...)
   359  	b = append(b, ksb.monthsAbbreviated[t.Month()]...)
   360  	b = append(b, []byte{0x20}...)
   361  
   362  	if t.Year() > 0 {
   363  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   364  	} else {
   365  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   366  	}
   367  
   368  	return string(b)
   369  }
   370  
   371  // FmtDateLong returns the long date representation of 't' for 'ksb_TZ'
   372  func (ksb *ksb_TZ) FmtDateLong(t time.Time) string {
   373  
   374  	b := make([]byte, 0, 32)
   375  
   376  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   377  	b = append(b, []byte{0x20}...)
   378  	b = append(b, ksb.monthsWide[t.Month()]...)
   379  	b = append(b, []byte{0x20}...)
   380  
   381  	if t.Year() > 0 {
   382  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   383  	} else {
   384  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   385  	}
   386  
   387  	return string(b)
   388  }
   389  
   390  // FmtDateFull returns the full date representation of 't' for 'ksb_TZ'
   391  func (ksb *ksb_TZ) FmtDateFull(t time.Time) string {
   392  
   393  	b := make([]byte, 0, 32)
   394  
   395  	b = append(b, ksb.daysWide[t.Weekday()]...)
   396  	b = append(b, []byte{0x2c, 0x20}...)
   397  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   398  	b = append(b, []byte{0x20}...)
   399  	b = append(b, ksb.monthsWide[t.Month()]...)
   400  	b = append(b, []byte{0x20}...)
   401  
   402  	if t.Year() > 0 {
   403  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   404  	} else {
   405  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   406  	}
   407  
   408  	return string(b)
   409  }
   410  
   411  // FmtTimeShort returns the short time representation of 't' for 'ksb_TZ'
   412  func (ksb *ksb_TZ) FmtTimeShort(t time.Time) string {
   413  
   414  	b := make([]byte, 0, 32)
   415  
   416  	if t.Hour() < 10 {
   417  		b = append(b, '0')
   418  	}
   419  
   420  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   421  	b = append(b, ksb.timeSeparator...)
   422  
   423  	if t.Minute() < 10 {
   424  		b = append(b, '0')
   425  	}
   426  
   427  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   428  
   429  	return string(b)
   430  }
   431  
   432  // FmtTimeMedium returns the medium time representation of 't' for 'ksb_TZ'
   433  func (ksb *ksb_TZ) FmtTimeMedium(t time.Time) string {
   434  
   435  	b := make([]byte, 0, 32)
   436  
   437  	if t.Hour() < 10 {
   438  		b = append(b, '0')
   439  	}
   440  
   441  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   442  	b = append(b, ksb.timeSeparator...)
   443  
   444  	if t.Minute() < 10 {
   445  		b = append(b, '0')
   446  	}
   447  
   448  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   449  	b = append(b, ksb.timeSeparator...)
   450  
   451  	if t.Second() < 10 {
   452  		b = append(b, '0')
   453  	}
   454  
   455  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   456  
   457  	return string(b)
   458  }
   459  
   460  // FmtTimeLong returns the long time representation of 't' for 'ksb_TZ'
   461  func (ksb *ksb_TZ) FmtTimeLong(t time.Time) string {
   462  
   463  	b := make([]byte, 0, 32)
   464  
   465  	if t.Hour() < 10 {
   466  		b = append(b, '0')
   467  	}
   468  
   469  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   470  	b = append(b, ksb.timeSeparator...)
   471  
   472  	if t.Minute() < 10 {
   473  		b = append(b, '0')
   474  	}
   475  
   476  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   477  	b = append(b, ksb.timeSeparator...)
   478  
   479  	if t.Second() < 10 {
   480  		b = append(b, '0')
   481  	}
   482  
   483  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   484  	b = append(b, []byte{0x20}...)
   485  
   486  	tz, _ := t.Zone()
   487  	b = append(b, tz...)
   488  
   489  	return string(b)
   490  }
   491  
   492  // FmtTimeFull returns the full time representation of 't' for 'ksb_TZ'
   493  func (ksb *ksb_TZ) FmtTimeFull(t time.Time) string {
   494  
   495  	b := make([]byte, 0, 32)
   496  
   497  	if t.Hour() < 10 {
   498  		b = append(b, '0')
   499  	}
   500  
   501  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   502  	b = append(b, ksb.timeSeparator...)
   503  
   504  	if t.Minute() < 10 {
   505  		b = append(b, '0')
   506  	}
   507  
   508  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   509  	b = append(b, ksb.timeSeparator...)
   510  
   511  	if t.Second() < 10 {
   512  		b = append(b, '0')
   513  	}
   514  
   515  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   516  	b = append(b, []byte{0x20}...)
   517  
   518  	tz, _ := t.Zone()
   519  
   520  	if btz, ok := ksb.timezones[tz]; ok {
   521  		b = append(b, btz...)
   522  	} else {
   523  		b = append(b, tz...)
   524  	}
   525  
   526  	return string(b)
   527  }
   528  

View as plain text