Golang获取整点的时间戳

版权声明:版权声明:本文为邵聪聪(聪少)原创文章,请随意转载并注明出处。 https://blog.csdn.net/cto_scc/article/details/53538853


func HourTimestamp() int64 {
    now := time.Now()
    timestamp := now.Unix() - int64(now.Second()) - int64((60 * now.Minute()))
    fmt.Println(timestamp, time.Unix(timestamp, 0), now.Unix())
    return timestamp
}

猜你喜欢

转载自blog.csdn.net/cto_scc/article/details/53538853