常用类型及数据操作方法
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

47 lines
937 B

package helper
import (
"testing"
"time"
// "time"
)
// func Test_FormatDate(t *testing.T) {
// str := "1110"
// strconv := FormatDate(str)
// t.Log(strconv)
// timing := "2019/1/1 8:28"
// ret, err := time.ParseInLocation("2006/1/2 15:04", timing, time.Local)
// t.Log(ret.Unix())
// t.Log(err)
// }
// func Test_GetToadyStartTimeStamp(t *testing.T) {
// t.Log(GetMonthStartTimeStamp())
// }
// func Test_RFC3339ToCSTLayout(t *testing.T) {
// cur := "2018-06-08T10:34:56+08:00"
// ret, err := RFC3339ToCSTLayout(cur)
// t.Log(ret)
// t.Log(err)
// }
func Test_GetTodayStartTimeStamp(t *testing.T) {
reserve_date := "2023-05-15"
reserveTime, err := time.ParseInLocation("2006-01-02", reserve_date, time.Local)
if err != nil {
t.Log("err:", err)
}
// 今天0点的时间戳
t.Log(reserveTime.Unix())
}
func Test_DatetimeToUnix(t *testing.T) {
date := "2023-09-01 00:00:00"
t.Log(DatetimeToUnix(date))
}