![image.png](https://static.studygolang.com/171130/a122119e186965413971131b6f9b9e28.png)
package main
import (
"fmt"
"time"
)
func main() {
todayLast := time.Now().Format("2006-01-02") + " 23:59:59"
todayLastTime, _ := time.ParseInLocation("2006-01-02 15:04:05", todayLast, time.Local)
remainSecond := time.Duration(todayLastTime.Unix()-time.Now().Local().Unix()) * time.Second
fmt.Println(remainSecond)
}
有疑问加站长微信联系(非本文作者)