fix time bug

pull/51/head
肥羊 2 years ago
parent 754a7a194a
commit 50e8b97a00
  1. 5
      Golang/main.go

@ -32,7 +32,10 @@ func duanyan(adurl string, realurl any) string {
} }
func getTestVideoUrl(c *gin.Context) { func getTestVideoUrl(c *gin.Context) {
TimeLocation, _ := time.LoadLocation("Asia/Shanghai") TimeLocation, err := time.LoadLocation("Asia/Shanghai")
if err != nil {
TimeLocation = time.FixedZone("CST", 8*60*60)
}
str_time := time.Now().In(TimeLocation).Format("2006-01-02 15:04:05") str_time := time.Now().In(TimeLocation).Format("2006-01-02 15:04:05")
fmt.Fprintln(c.Writer, "#EXTM3U") fmt.Fprintln(c.Writer, "#EXTM3U")
fmt.Fprintln(c.Writer, "#EXTINF:-1 tvg-name=\""+str_time+"\" tvg-logo=\"https://cdn.jsdelivr.net/gh/youshandefeiyang/IPTV/logo/tg.jpg\" group-title=\"列表更新时间\","+str_time) fmt.Fprintln(c.Writer, "#EXTINF:-1 tvg-name=\""+str_time+"\" tvg-logo=\"https://cdn.jsdelivr.net/gh/youshandefeiyang/IPTV/logo/tg.jpg\" group-title=\"列表更新时间\","+str_time)

Loading…
Cancel
Save