With this simple function, I can get the week number. Now, with the number of the week, how can I get the date range, started on Sunday?
import (
"fmt"
"time"
)
func main() {
Week(time.Now().UTC())
}
func Week(now time.Time) string {
_, thisWeek := now.ISOWeek()
return "S" + strconv.Itoa(thisWeek)
}
Any help is welcome. Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…