You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
457 B
Go

// Package simpletime -----------------------------
// @file : week_test.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2022/8/31 14:57
// -------------------------------------------
package stime
import (
"testing"
"time"
)
func TestGetYearWeek(t *testing.T) {
now := time.Now()
t.Log(GetYearWeek(&now))
var w = int(now.Weekday())
t.Log(now.AddDate(0, 0, -w+1).Weekday())
t.Log(now.AddDate(0, 0, 7-w).Weekday())
}