// TimeFormat parses with given format and returns time.Time type value.
163073
func (k *Key) TimeFormat(format string) (time.Time, error) {
	return time.Parse(format, k.String())
}
923271
func isTimeFormat(format string) bool {
	dateParts := []string{
		"yy", "hh", "am", "pm", "ss", "mm", ":",
	}
	for _, part := range dateParts {
		if strings.Contains(format, part) {
			return true
		}
	}
	return false
}
1200049
func (s *ListTypesInput) SetFormat(v string) *ListTypesInput {
	s.Format = &v
	return s
}
1197136
func (l *Logger) SetTimeFormat(s string) *Logger {
	l.mu.Lock()
	l.TimeFormat = s
	l.mu.Unlock()

	return l
}
664407
func FormatDateTimeField(key string, val time.Time) (string, string) {
	return key + ";VALUE=DATE-TIME", val.Format("20060102T150405")
}
1021899
func (c Calendar) Format(datetime time.Time, pattern string) (string, error) {
	parsed, err := c.parseDateTimeFormat(pattern)
	if err != nil {
		return "", err
	}

	return c.formatDateTime(datetime, parsed)
}
803975
func Format(format string, t time.Time) (result string, err error) {
	defer func() {
		if e := recover(); e != nil {
			result = ""
			err = e.(error)
		}
	}()

	fn := func(match string) string {
		return repl(match, t)
	}
	return fmtRe.ReplaceAllStringFunc(format, fn), nil
}
1300312
func (ts TimeStamp) Format(f string) string {
	return ts.AsTime().Format(f)
}
490588
func (email *Email) SetTimestampFormat(format string) {
	email.rw.Lock()
	defer email.rw.Unlock()

	email.timestampFormat = format
}
1282594
func (l *Logger) SetTimeFormat(timeFormat string) *Logger {
	l.mu.Lock()
	defer l.mu.Unlock()
	l.tf = timeFormat
	return l
}
454212
func GetFormat(in io.Reader) (*Format, error) {
	var dec vorbis.Decoder
	r := oggReader{source: in}
	p, err := r.NextPacket()
	if err != nil {
		return nil, err
	}
	err = dec.ReadHeader(p)
	if err != nil {
		return nil, err
	}
	return &Format{
		SampleRate: dec.SampleRate(),
		Channels:   dec.Channels(),
		Bitrate:    dec.Bitrate,
	}, nil
}
749882
func IsDateFormat(format string) bool {
	format = strings.TrimSpace(format)
	seps := ParseDateFormat(format)
	length := len(format)
	switch len(seps) {
	case 1:
		if (length == 8) || (length == 6) {
			return true
		}
	case 3:
		return true
	}
	return false
}
98532
func (timeCache *timeFormatCacheType) Format() []byte {
	timeCache.lock.RLock()
	defer timeCache.lock.RUnlock()

	return timeCache.format
}
75150
func Time(timeFormat string) Formatter {
	return func(buffer Buffer, event *cue.Event) {
		buffer.AppendString(event.Time.Format(timeFormat))
	}
}
979785
func (s *Thumbnails) SetFormat(v string) *Thumbnails {
	s.Format = &v
	return s
}
1350335
func anyTimeFormat(format string, times ...time.Time) string {
	for _, t := range times {
		if !t.IsZero() {
			return t.Format(format)
		}
	}
	return ""
}
339066
func (b *builtinTimeFormatSig) formatTime(ctx sessionctx.Context, t types.Duration, formatMask string) (res string, err error) {
	t2 := types.Time{
		Time: types.FromDate(0, 0, 0, t.Hour(), t.Minute(), t.Second(), t.MicroSecond()),
		Type: mysql.TypeDate, Fsp: 0}

	str, err := t2.DateFormat(formatMask)
	return str, err
}