Open
Conversation
Author
|
额,我该rebase到develop branch然后提PR到develop? |
Sora233
reviewed
Aug 25, 2022
| func TimestampFormat(ts int64) string { | ||
| t := time.Unix(ts, 0) | ||
| if tzStr := config.GlobalConfig.GetString("timezone"); tzStr != "" { | ||
| loc, _ := time.LoadLocation(tzStr) |
Owner
There was a problem hiding this comment.
有些服务器可能没装额外的tzinfo,在这里如果有报错希望能够有日志提醒
Owner
|
另外如果是设置时区的话希望可以全局设置来保持一致性,例如启动读取配置文件后一次性设置下 |
Author
是说连logging之类的其他用到时间戳的地方都保持一致么?我感觉logging的话还是服务器本地时区更方便一些,所以只是对输出的时间戳加了时区变化。 不过只在启动时取一次时区是正确的做法,我看看怎么搞比较方便简洁。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
部署到外面发现时区出问题了所以...
偷懒直接用了GlobalConfig,如果觉得在util包里直接用config不好的话我改改。