// Date will generate a random time.Time struct
421039
func Date() time.Time {
	return time.Date(Year(), time.Month(Number(0, 12)), Day(), Hour(), Minute(), Second(), NanoSecond(), time.UTC)
}
568044
func MatchDate(date time.Time, c *imap.SearchCriteria) bool {
	date = date.Round(24 * time.Hour)
	if !c.Since.IsZero() && !date.After(c.Since) {
		return false
	}
	if !c.Before.IsZero() && !date.Before(c.Before) {
		return false
	}

	for _, not := range c.Not {
		if MatchDate(date, not) {
			return false
		}
	}
	for _, or := range c.Or {
		if !MatchDate(date, or[0]) && !MatchDate(date, or[1]) {
			return false
		}
	}
	return true
}
57631
func DateToTime(d *google_type.Date) time.Time {
	if d == nil {
		return time.Unix(0, 0).UTC()
	}
	return time.Date(int(d.Year), time.Month(d.Month), int(d.Day), 0, 0, 0, 0, time.UTC)
}
153884
func (s *TransactWriteItem) SetUpdate(v *Update) *TransactWriteItem {
	s.Update = v
	return s
}
112622
func (logger *Logger) time(r *record) interface{} {
	return r.time.Format(logger.timeFormat)
}
1184480
func toLocalDate(t time.Time) Date {
	y, m, d := t.Date()
	return DateFor(y, m, d)
}
75150
func Time(timeFormat string) Formatter {
	return func(buffer Buffer, event *cue.Event) {
		buffer.AppendString(event.Time.Format(timeFormat))
	}
}
209410
func dateToUint64(t MysqlTime) uint64 {
	return uint64(t.Year())*10000 +
		uint64(t.Month())*100 +
		uint64(t.Day())
}
810510
func (c Context) Time(key string, t time.Time) Context {
	c.l.context = enc.AppendTime(enc.AppendKey(c.l.context, key), t, TimeFieldFormat)
	return c
}
1299731
func (c *Client) Time(stat string, rate float64, f func()) error {
	ts := time.Now()
	f()
	return c.Duration(stat, time.Since(ts), rate)
}
957847
func (b *Builder) Time(ts time.Time) *Builder {
	b.TimeSec = uint64(ts.Unix())
	b.TimeNsec = uint32(ts.Nanosecond())
	return b
}
382935
func (c *CommitAuthor) GetDate() time.Time {
	if c == nil || c.Date == nil {
		return time.Time{}
	}
	return *c.Date
}
1366213
func (t *Time) StrToDate(date, format string) bool {
	ctx := make(map[string]int)
	var tm mysqlTime
	if !strToDate(&tm, date, format, ctx) {
		t.Time = ZeroTime
		t.Type = mysql.TypeDatetime
		t.Fsp = 0
		return false
	}
	if err := mysqlTimeFix(&tm, ctx); err != nil {
		return false
	}

	t.Time = tm
	t.Type = mysql.TypeDatetime
	if t.check() != nil {
		return false
	}
	return true
}
662539
func (timestamp *Timestamp) Time() time.Time {
	return time.Date(timestamp.Year, time.Month(timestamp.Month), timestamp.Day,
		timestamp.Hour, timestamp.Min, timestamp.Sec, timestamp.NanoSec, time.UTC)
}
568944
func (d Date) Value() (driver.Value, error) {
	year, month, day := d.Date()
	return time.Date(year, month, day, 0, 0, 0, 0, time.UTC), nil
}
321379
func (c *Carbon) SetDate(y int, m time.Month, d int) {
	c.Time = time.Date(y, m, d, c.Hour(), c.Minute(), c.Second(), c.Nanosecond(), c.Location())
}
328716
func DateS(ts string, format string) string {
	i, _ := strconv.ParseInt(ts, 10, 64)
	return Date(i, format)
}