出现这个问题一般是使用了time.LoadLocation,它依赖于 IANA Time Zone Database (简称 tzdata 吧) ,一般linux系统都带了,但是有的windows系统没带。
引用LoadLocation方法前使用加上一句
os.Setenv("ZONEINFO", 'xx/xx/data.zip')
data.zip已上传至github:https://github.com/lesroad/tzdata
博客指出使用time.LoadLocation时会依赖IANA Time Zone Database(tzdata),Linux系统一般自带,但部分Windows系统没有。还给出解决办法,即在引用LoadLocation方法前添加相关内容,同时提供了已上传至GitHub的data.zip文件链接。
出现这个问题一般是使用了time.LoadLocation,它依赖于 IANA Time Zone Database (简称 tzdata 吧) ,一般linux系统都带了,但是有的windows系统没带。
引用LoadLocation方法前使用加上一句
os.Setenv("ZONEINFO", 'xx/xx/data.zip')
data.zip已上传至github:https://github.com/lesroad/tzdata
4180
4526