code: func builtinSecond(args []types.Datum, ctx context.Context) (types.Datum, error) {
  	d, err := convertToDuration(ctx.GetSessionVars().StmtCtx, args[0], types.MaxFsp)
  	if err != nil || d.IsNull() {
  		return d, errors.Trace(err)
  	}
  
  	// No need to check type here.
  	s := int64(d.GetMysqlDuration().Second())
  	d.SetInt64(s)
  	return d, nil
  }
docs: // See http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_second