支付宝 接入一系列修改

This commit is contained in:
2025-02-08 16:30:07 +08:00
parent 27aff930c7
commit cbdce12462
31 changed files with 1432 additions and 357 deletions

View File

@@ -5,16 +5,7 @@ import (
"time"
)
/*func GetZeroTime(t int64, timezone int) int64 {
return t - (t+int64(timezone))%86400
}
func IsDiffDay(second, first int64, timezone int) int {
secondZeroTime := GetZeroTime(second, timezone)
firstZeroTime := GetZeroTime(first, timezone)
return int(secondZeroTime/86400 - firstZeroTime/86400)
}*/
// 计算两个时间戳之间间隔多少天
func DiffDays(new, old int64) int64 {
newZeroTime := ZeroTime(new, 0)
oldZeroTime := ZeroTime(old, 0)
@@ -27,3 +18,9 @@ func ZeroTime(sec, nsec int64) int64 {
t, _ := time.ParseInLocation("2006-01-02", dateStr, time.Local)
return t.Unix()
}
func IsSameDay(first, second int64) bool {
firstZero := ZeroTime(first, 0)
secondZero := ZeroTime(second, 0)
return firstZero == secondZero
}