Get Time Duration in Go
package main
import (
"fmt"
"time"
)
func main() {
p := fmt.Println
now := time.Now()
then := time.Date(
2009, 11, 17, 20, 34, 58, 651387237, time.UTC)
// The Sub methods returns a Duration representing the interval between two times.
diff := now.Sub(then)
p(diff)
p(diff.Hours())
p(diff.Minutes())
p(diff.Seconds())
p(diff.Nanoseconds())
}