// handleUptime implements the uptime command.
485729
func handleUptime(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {
	return time.Now().Unix() - s.cfg.StartupTime, nil
}
154152
func (eh userNoteUpdateEventHandler) Handle(s *Session, i interface{}) {
	if t, ok := i.(*UserNoteUpdate); ok {
		eh(s, t)
	}
}
963088
func parseTime(t string) (time.Time, error) {
	for _, tf := range timeFormats {
		time, err := time.Parse(tf, t)
		if err == nil {
			log.Debug("timeparse: found format", tf)
			return time, nil
		}
	}
	return time.Time{}, ErrInvalidTimeFormat
}
1135748
func ParseTime(layout string, timeStr string) time.Time {
	res, err := time.Parse(layout, timeStr)
	if err != nil {
		panic(err)
	}
	return res
}
281763
func handleInvalidTimeError(ctx sessionctx.Context, err error) error {
	if err == nil || !(terror.ErrorEqual(err, types.ErrInvalidTimeFormat) || types.ErrIncorrectDatetimeValue.Equal(err) ||
		types.ErrTruncatedWrongValue.Equal(err) || types.ErrInvalidWeekModeFormat.Equal(err) ||
		types.ErrDatetimeFunctionOverflow.Equal(err)) {
		return err
	}
	sc := ctx.GetSessionVars().StmtCtx
	if ctx.GetSessionVars().StrictSQLMode && (sc.InInsertStmt || sc.InUpdateStmt || sc.InDeleteStmt) {
		return err
	}
	sc.AppendWarning(err)
	return nil
}
1151692
func (b *builtinUTCTimestampWithoutArgSig) evalTime(row chunk.Row) (types.Time, bool, error) {
	result, isNull, err := evalUTCTimestampWithFsp(b.ctx, 0)
	return result, isNull, err
}
398621
func (p *Process) GetUptime() time.Duration {
	if p.startTime.Nanosecond() == 0 {
		return 0
	}
	return time.Since(p.startTime)
}
343098
func (s *Subscription) Handle(es string, h HandlerFunc) error {
	if _, ok := validEvents[es]; !ok {
		return fmt.Errorf("unknown event: %s", es)
	}

	s.lock.Lock()
	s.handlers[es] = h
	s.lock.Unlock()
	return nil
}
491327
func (a *Aggregate) HandleCommand(ctx context.Context, cmd eh.Command) error {
	if a.Err != nil {
		return a.Err
	}
	a.Commands = append(a.Commands, cmd)
	a.Context = ctx
	return nil
}
517787
func (fi *linuxExFileInfo) CTime() time.Time {
	return timespecToTime(fi.Sys().(*syscall.Stat_t).Ctim)
}
6067
func (eh messageDeleteBulkEventHandler) Handle(s *Session, i interface{}) {
	if t, ok := i.(*MessageDeleteBulk); ok {
		eh(s, t)
	}
}
1136927
func (fi *darwinExFileInfo) CTime() time.Time {
	return timespecToTime(fi.Sys().(*syscall.Stat_t).Ctimespec)
}
404885
func handle_errors(err error) {
	if err != nil {
		log.Printf("Error %v\n", err)
		os.Exit(1)
	}
}
548808
func HandlerAscTime(entry *logrus.Entry, formatter *CustomFormatter) (interface{}, error) {
	return entry.Time.Format(formatter.TimestampFormat), nil
}
843952
func (eh userGuildSettingsUpdateEventHandler) Handle(s *Session, i interface{}) {
	if t, ok := i.(*UserGuildSettingsUpdate); ok {
		eh(s, t)
	}
}
274860
func ParseTime(influxQL string, now time.Time) (time.Duration, error) {
	start := strings.Index(strings.ToUpper(influxQL), WhereToken)
	if start == -1 {
		return 0, fmt.Errorf("not a relative duration")
	}
	start += len(WhereToken)
	where := influxQL[start:]
	cond, err := influxql.ParseExpr(where)
	if err != nil {
		return 0, err
	}
	nowVal := &influxql.NowValuer{
		Now: now,
	}
	cond = influxql.Reduce(cond, nowVal)
	min, max, err := TimeRangeAsEpochNano(cond, now)
	if err != nil {
		return 0, err
	}
	dur := time.Duration(max - min)
	if dur < 0 {
		dur = 0
	}
	return dur, nil
}
218410
func (b *Bdiscord) handleUploadFile(msg *config.Message, channelID string) (string, error) {
	var err error
	for _, f := range msg.Extra["file"] {
		fi := f.(config.FileInfo)
		file := discordgo.File{
			Name:        fi.Name,
			ContentType: "",
			Reader:      bytes.NewReader(*fi.Data),
		}
		m := discordgo.MessageSend{
			Content: msg.Username + fi.Comment,
			Files:   []*discordgo.File{&file},
		}
		_, err = b.c.ChannelMessageSendComplex(channelID, &m)
		if err != nil {
			return "", fmt.Errorf("file upload failed: %s", err)
		}
	}
	return "", nil
}