|
|
package xtime
|
|
|
|
|
|
import "time"
|
|
|
import (
|
|
|
"math"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
// 当天的末尾时间, 例 2006-01-02 23:59:59
|
|
|
func DayEndTime(t time.Time) time.Time {
|
...
|
...
|
@@ -22,6 +25,6 @@ func SubDayAbs(t1, t2 time.Time) int { |
|
|
day2 := DayZeroTime(t2)
|
|
|
|
|
|
t3 := day1.Sub(day2)
|
|
|
h := int(t3.Abs().Hours())
|
|
|
h := int(math.Abs(t3.Hours()))
|
|
|
return (h / 24) + 1
|
|
|
} |
...
|
...
|
|