golang 获取第二天 00:00:00 时间戳

时间:2021-05-11 09:07:59

标签: go time timestamp

我遇到一个问题,在 golang 中获取第二天 00:00:00 时间戳的最佳方法。这是我的解决方案:

currentTime := time.Now()
nextDayTimestamp := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day()+1, 0, 0, 0, 0, currentTime.Location())

有没有更好的解决方案?

0 个答案:

没有答案