ddkwork / golibrary

Apache License 2.0
0 stars 1 forks source link

time sub days #1

Closed ddkwork closed 1 year ago

ddkwork commented 1 year ago

package main

import ( "fmt" "time" )

func main() { a, := time.Parse("2006-01-02", "2017-09-01") b, := time.Parse("2006-01-02", "2018-03-11") d := a.Sub(b)

fmt.Println(d.Hours() / 24)

}