func (t *Task) SetPrev(now time.Time) {
	t.Prev = now
}
SetPrev set prev time of this task
package toolbox
import (
	"log"
	"math"
	"sort"
	"strconv"
	"strings"
	"time"
)
type bounds struct {
	min, max uint
	names    map[string]uint
}
var (
	AdminTaskList map[string]Tasker
	stop          chan bool
	changed       chan bool
	isstart       bool
	seconds       = bounds{0, 59, nil}
	minutes       = bounds{0, 59, nil}
	hours         = bounds{0, 23, nil}
	days          = bounds{1, 31, nil}
	months        = bounds{1, 12, map[string]uint{
		"jan": 1,
		"feb": 2,
		"mar": 3,
		"apr": 4,
		"may": 5,
		"jun": 6,
		"jul": 7,
		"aug": 8,
		"sep": 9,
		"oct": 10,
		"nov": 11,
		"dec": 12,
	}}
	weeks = bounds{0, 6, map[string]uint{
		"sun": 0,
		"mon": 1,
		"tue": 2,
		"wed": 3,
		"thu": 4,
		"fri": 5,
		"sat": 6,
	}}
)
const (
	starBit = 1 << 63
)
type Schedule struct {
	Second uint64
	Minute uint64
	Hour   uint64
	Day    uint64
	Month  uint64
	Week   uint64
}
type TaskFunc func() error
type Tasker interface {
	GetSpec() string
	GetStatus() string
	Run() error
	SetNext(time.Time)
	GetNext() time.Time
	SetPrev(time.Time)
	GetPrev() time.Time
}
type taskerr struct {
	t       time.Time
	errinfo string
}
type Task struct {
	Taskname string
	Spec     *Schedule
	SpecStr  string
	DoFunc   TaskFunc
	Prev     time.Time
	Next     time.Time
	Errlist  []*taskerr  
	ErrLimit int         
}
func NewTask(tname string, spec string, f TaskFunc) *Task {
	task := &Task{
		Taskname: tname,
		DoFunc:   f,
		ErrLimit: 100,
		SpecStr:  spec,
	}
	task.SetCron(spec)
	return task
}
func (t *Task) GetSpec() string {
	return t.SpecStr
}
func (t *Task) GetStatus() string {
	var str string
	for _, v := range t.Errlist {
		str += v.t.String() + ":" + v.errinfo + "<br>"
	}
	return str
}
func (t *Task) Run() error {
	err := t.DoFunc()
	if err != nil {
		if t.ErrLimit > 0 && t.ErrLimit > len(t.Errlist) {
			t.Errlist = append(t.Errlist, &taskerr{t: t.Next, errinfo: err.Error()})
		}
	}
	return err
}
func (t *Task) SetNext(now time.Time) {
	t.Next = t.Spec.Next(now)
}
func (t *Task) GetNext() time.Time {
	return t.Next
}