Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

时区非 UTC 时显示时间不准确 #1639

Closed
fisherzrj opened this issue Nov 28, 2023 · 1 comment
Closed

时区非 UTC 时显示时间不准确 #1639

fisherzrj opened this issue Nov 28, 2023 · 1 comment
Assignees
Labels
🐞 bug Something isn't working

Comments

@fisherzrj
Copy link

Dify version

v0.3.32

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. 将部署服务器的时区设置为东八区
  2. 将设置语言中的时区设置为东八区
  3. 随意创建一个应用并使用
  4. 可以发现 日志与标注 中的时间比预期东八区的时间多了八小时

大概看了一下源码,应该是conversations表的创建语句问题,created_at、updated_at 用的是当前时区时间而 read_at 用的却是 UTC 时间,两个时间系统不一致
WX20231128-145554@2x

建议default值使用类似SET DEFAULT timezone('UTC', CURRENT_TIMESTAMP(0))的写法也使用 UTC 时间

另:刚发现直接修改数据库时间会导致 日志与标注 中过滤时间的下拉框不准确,怀疑此处用的时间未转为 UTC 时间

✔️ Expected Behavior

1、时间显示应该与当前时区保持一致
2、数据库中不应该出现多种不同时区的时间

❌ Actual Behavior

时间比当前时区多了八小时

@fisherzrj fisherzrj added the 🐞 bug Something isn't working label Nov 28, 2023
@crazywoola
Copy link
Member

Close due to #1542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants