Comments (4)
这确实是一个问题,感谢反馈。
这个问题仅发生在 Windows 操作系统,目前临时的解决办法是:
-
下载一份时间数据库 zoneinfo.zip 到你的 Windows Server 服务器,例如:
D:/zoneinfo.zip
https://github.com/golang/go/blob/master/lib/time/zoneinfo.zip
-
配置环境变量
ZONEINFO
如图:
- 重新打开命令行运行即可
或者可以直接命令行执行 set ZONEINFO=D:/zoneinfo.zip
临时修改环境变量。
from artalkgo.
这是 Go 程序一个普遍存在的问题(如果用了 time.LoadLocation 函数),LoadLocation 这个函数依赖于 IANA Time Zone Database (简称 tzdata) 数据库,一般 Linux 系统都是自带的,而 Windows 系统没有。
所以如果没有这个数据库文件的话,就会去查 $GOROOT/lib/time/zoneinfo.zip
,但需要装了 Golang 编译器才有。
可以手动配置 ZONEINFO
这个环境变量来指定时间数据库文件。
为了简单起见,之后我打算把这个文件内置到程序 exe 文件中,无需再额外配置。
from artalkgo.
看了一些相关内容,最后打算仅在编译 Windows 版的时候,给 Golang 编译器带上 -tags timetzdata
参数,内置到 exe 文件中,但 exe 文件会增大 800K
from artalkgo.
新版构建已发布 v2.1.9
from artalkgo.
Related Issues (20)
- Artalk支持 远程Redis来缓存嘛 HOT 3
- 验证码数据根据 IP 来存储问题 HOT 1
- upgit 图片上传 HOT 2
- 性能优化 HOT 3
- Redis 缓存相关导致报错 HOT 11
- API 新增建议 HOT 11
- [Bug Report] Telegram 评论通知 HOT 27
- [Bug Report] 开启评论审核后无法发送回复通知 HOT 17
- 能否增加企业微信通知或者提供一个自定义的WebHook HOT 4
- 如何使用带有密码认证的Redis缓存 HOT 1
- 随机查询 HOT 8
- 非管理员用户侧边栏提示错误:Referer 不被允许 HOT 5
- 优化关于docker的配置文件映射问题 HOT 2
- 配置可信域名后前端依旧提升跨域不能访问 HOT 2
- api 返回最新评论,增加返回用户头像地址。。 HOT 3
- 管理员地址是什么,文档没介绍后端管理地址,没找到 HOT 2
- 导入评论时必须指定目标站点 URL的问题 HOT 2
- 使用控制中心自带的导入其他系统的评论功能成功后不能在评论表单下面显示,只能在控制中心看 HOT 1
- 飞书通知设置无效 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from artalkgo.