mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-07 22:22:29 +08:00
feat:add betweenSeconds func (#102)
Co-authored-by: leitao <leitao@kezaihui.com>
This commit is contained in:
@@ -353,3 +353,18 @@ func ExampleIsLeapYear() {
|
||||
// true
|
||||
// false
|
||||
}
|
||||
|
||||
func ExampleBetweenSeconds() {
|
||||
now := time.Now()
|
||||
target := AddDay(now, 1)
|
||||
|
||||
now1 := time.Now()
|
||||
target1 := AddDay(now, -1)
|
||||
|
||||
fmt.Println(BetweenSeconds(now, target))
|
||||
fmt.Println(BetweenSeconds(now1, target1))
|
||||
|
||||
// Output:
|
||||
// 86400
|
||||
// -86400
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user