修复长效时间问题

This commit is contained in:
2026-05-19 13:35:06 +08:00
parent 71554da541
commit dbc909c736
2 changed files with 7 additions and 7 deletions

View File

@@ -91,14 +91,14 @@ func DateTail(date time.Time) time.Time {
return time.Date(y, m, d, 23, 59, 59, 999999999, time.Local).UTC()
}
func Today() time.Time {
return DateHead(time.Now())
func IsSameDate(date1, date2 time.Time) bool {
var y1, m1, d1 = date1.Local().Date()
var y2, m2, d2 = date2.Local().Date()
return y1 == y2 && m1 == m2 && d1 == d2
}
func IsSameDate(date1, date2 time.Time) bool {
var y1, m1, d1 = date1.Date()
var y2, m2, d2 = date2.Date()
return y1 == y2 && m1 == m2 && d1 == d2
func Today() time.Time {
return DateHead(time.Now())
}
func IsToday(date time.Time) bool {

View File

@@ -157,7 +157,7 @@ func findResource(resourceId int32, now time.Time) (*ResourceView, error) {
var sub = resource.Long
info.LongId = &sub.ID
info.ExpireAt = sub.ExpireAt
info.Live = time.Duration(sub.Live) * time.Hour
info.Live = time.Duration(sub.Live) * time.Minute
info.Mode = sub.Type
info.Quota = sub.Quota
info.Used = sub.Used