// toDate converts a time into a storagetransfer friendly Date
557361
func toDate(ts time.Time) *storagetransfer.Date {
	return &storagetransfer.Date{
		Day:   int64(ts.Day()),
		Month: int64(ts.Month()),
		Year:  int64(ts.Year()),
	}
}
671279
func (d DateTime) Date(v reflect.Value) (interface{}, error) {
	return d.date(), nil
}
434069
func (h *Hook) GetUpdatedAt() time.Time {
	if h == nil || h.UpdatedAt == nil {
		return time.Time{}
	}
	return *h.UpdatedAt
}
946406
func (b *builtinUTCDateSig) evalTime(row chunk.Row) (types.Time, bool, error) {
	var nowTs = &b.ctx.GetSessionVars().StmtCtx.NowTs
	if nowTs.Equal(time.Time{}) {
		*nowTs = time.Now()
	}
	year, month, day := nowTs.UTC().Date()
	result := types.Time{
		Time: types.FromGoTime(time.Date(year, month, day, 0, 0, 0, 0, time.UTC)),
		Type: mysql.TypeDate,
		Fsp:  types.UnspecifiedFsp}
	return result, false, nil
}
862457
func (c *CronSchedule) Validate() error {
	if c.entry == "" {
		return ErrMissingCronEntry
	}
	_, err := cron.Parse(c.entry)
	if err != nil {
		return err
	}
	return nil
}
826505
func (s *SkipDays) Validate() error {
	skipDays := map[string]bool{
		"Monday":    true,
		"Tuesday":   true,
		"Wednesday": true,
		"Thursday":  true,
		"Friday":    true,
		"Saturday":  true,
		"Sunday":    true,
	}
	for _, day := range s.Days {
		if !skipDays[day] {
			return errors.New(ErrValidation, errorMessages, "skip day %q is invalid", day)
		}
	}
	return nil
}
1179015
func decodeDateTim4(buf []byte) time.Time {
	days := binary.LittleEndian.Uint16(buf)
	mins := binary.LittleEndian.Uint16(buf[2:])
	return time.Date(1900, 1, 1+int(days),
		0, int(mins), 0, 0, time.UTC)
}
1007714
func parseAmzDate(amzDateStr string) (amzDate time.Time, apiErr APIErrorCode) {
	for _, dateFormat := range amzDateFormats {
		amzDate, err := time.Parse(dateFormat, amzDateStr)
		if err == nil {
			return amzDate, ErrNone
		}
	}
	return time.Time{}, ErrMalformedDate
}
618324
func (dt DateTime) Date() (year int, month time.Month, day int) {
	return dt.t.Date()
}
763914
func Date(ti int64, format string) string {
	t := time.Unix(int64(ti), 0)
	return DateT(t, format)
}
886558
func parseDate(date string) (time.Time, error) {
	d, err := time.Parse("1/2/2006", date)
	if err != nil {
		return time.Time{}, err
	}

	return d, nil
}
565666
func (d date) NoonOnDate(cd time.Time) time.Time {
	return time.Date(cd.Year(), cd.Month(), cd.Day(), 12, 0, 0, 0, cd.Location())
}
676188
func (d durationMS) ToD() time.Duration {
	return time.Duration(d) * time.Millisecond
}
671184
func NewTimeData() TimeData {
	now := w.Now()
	return TimeData{
		CreationTime:         &now,
		LastModificationTime: &now,
		LastAccessTime:       &now,
		LocationChanged:      &now,
		Expires:              false,
		UsageCount:           0,
	}
}
765031
func oneTimeJobSchedule(ts time.Time) *storagetransfer.Schedule {
	date := toDate(ts)
	return &storagetransfer.Schedule{
		ScheduleEndDate:   date,
		ScheduleStartDate: date,
	}
}
444758
func (s *OutgoingCertificate) SetTransferDate(v time.Time) *OutgoingCertificate {
	s.TransferDate = &v
	return s
}
991080
func (i item) isDismissedAt(t time.Time) bool {
	if i.dismissedImmediate {
		return true
	}
	if i.dtime != nil && isBeforeOrSame(*i.dtime, t) {
		return true
	}
	if dt := i.item.DTime(); dt != nil && isBeforeOrSame(toTime(i.ctime, dt), t) {
		return true
	}
	return false
}