mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-17 16:12:42 +08:00
25 lines
391 B
Go
25 lines
391 B
Go
package dateconv
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestParseDuration(t *testing.T) {
|
|
t.Log(ParseDuration(""))
|
|
t.Log(ParseDuration("abc"))
|
|
}
|
|
|
|
func TestMonth(t *testing.T) {
|
|
month := time.Now()
|
|
|
|
offset := (int(month.Month()) - 3)
|
|
t.Log(offset)
|
|
|
|
month = month.AddDate(0, -3, 1)
|
|
t.Log(month)
|
|
|
|
tt := time.Date(month.Year(), month.Month(), 1, 0, 0, 0, 0, month.Location())
|
|
t.Log(tt)
|
|
}
|