-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
var dd = "2023-01-30 12:45:23"
loc, _ := time.LoadLocation("Local")
dt, _ := time.ParseInLocation("2006-01-02 15:04:05", dd, loc)
r, _ = rrule.NewRRule(rrule.ROption{
Freq: rrule.MONTHLY,
//Bymonthday: []int{},
// Bymonth: []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, // 取哪一月的数据
Interval: 1,
Until: time.Now().AddDate(0, 5, 0),
Dtstart: dt,
})
//set.ExDate(time.Now())
for _, t2 := range r.All() {
fmt.Println(t2.Format("2006-01-02 15:04:05"))
}
result:
2023-01-30 12:45:23
2023-03-30 12:45:23
2023-04-30 12:45:23
2023-05-30 12:45:23
2023-06-30 12:45:23
2023-02-28 12:45:23 How to achieve?
thank you
Metadata
Metadata
Assignees
Labels
No labels