mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-09 07:02:29 +08:00
feat:add betweenSeconds func (#102)
Co-authored-by: leitao <leitao@kezaihui.com>
This commit is contained in:
@@ -230,3 +230,8 @@ func EndOfYear(t time.Time) time.Time {
|
||||
func IsLeapYear(year int) bool {
|
||||
return year%4 == 0 && (year%100 != 0 || year%400 == 0)
|
||||
}
|
||||
|
||||
func BetweenSeconds(t1 time.Time, t2 time.Time) int64 {
|
||||
index := t2.Unix() - t1.Unix()
|
||||
return index
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user