func (this *Builtins) SetBizdate(d string) error { bizdate, err := time.Parse(d, "YYYYMMDD") if err != nil { log.Fatalf("invalid bizdate: %s", config.Bizdate) return err } this.builtins["gmtdate"] = ast.NewDate(bizdate.AddDate(0, 0, 1), "YYYYMMDD") this.builtins["bizdate"] = ast.NewDate(bizdate, "YYYYMMDD") return nil }
func TestParse(t *testing.T) { fmt.Println(time.Parse("20060102 03:04:05", "YYYYMMDD hh:mm:ss")) }