mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
日历相关计算
This commit is contained in:
19
calendar/output_test.go
Normal file
19
calendar/output_test.go
Normal file
@ -0,0 +1,19 @@
|
||||
package calendar_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/charlienet/go-mixed/calendar"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestDayInt(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
n := time.Date(2022, 11, 9, 14, 28, 34, 123456789, time.UTC)
|
||||
|
||||
assert.Equal(20221109, calendar.Create(n).ToShortDateInt())
|
||||
assert.Equal(202211, calendar.Create(n).ToMonthInt())
|
||||
assert.Equal(20221109142834, calendar.Create(n).ToDateTimeInt())
|
||||
}
|
Reference in New Issue
Block a user