1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-17 16:12:42 +08:00
Files
go-mixed/calendar/output_test.go
2022-11-09 17:16:24 +08:00

20 lines
441 B
Go

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())
}