Timestamp in Logs is 12 Hours Behind Despite Correct Timezone #13123

Closed
opened 2026-02-21 19:10:40 -05:00 by yindo · 3 comments
Owner

Originally created by @adminxxt on GitHub (Apr 18, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

Image

Image

The creation time and update time of the log record are 12 hours less than the current time,
Default date configuration parameters used

✔️ Expected Behavior

@

Actual Behavior

No response

Originally created by @adminxxt on GitHub (Apr 18, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/c1dfaf9a-de18-445e-8bb9-46934523537f) ![Image](https://github.com/user-attachments/assets/7a571a02-21ab-4c46-a4cf-7c1d61713278) ![Image](https://github.com/user-attachments/assets/d3a80579-1c8a-44a5-a59e-62b842c85314) The creation time and update time of the log record are 12 hours less than the current time, Default date configuration parameters used ### ✔️ Expected Behavior @ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:10:40 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 18, 2025):

Hello @adminxxt! I'm Dosu, your friendly bot here to help you solve bugs, answer questions, and guide you on your journey to becoming a contributor. I'm here while you wait for a human maintainer. Let's tackle this together! 🚀

I found a similar closed issue where the timestamp in logs was behind despite correct timezone settings. The solution involved ensuring that the timezone environment variable in the docker-compose.yaml file is set correctly. You can modify the LOG_TZ environment variable to your desired timezone, such as "Asia/Shanghai" [1].

Additionally, there was a discussion about ensuring that the PostgreSQL database configuration file postgresql.conf has the correct timezone settings:

log_timezone = 'Asia/Shanghai'
timezone = 'Asia/Shanghai'

Also, make sure that the Docker container's timezone is set correctly by mapping the host's timezone files:

volumes:
  - /etc/localtime:/etc/localtime:ro
  - /etc/timezone:/etc/timezone:ro

After making these changes, restart the application to apply the new settings [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 18, 2025): <!-- Greeting --> Hello @adminxxt! I'm [Dosu](https://dosu.dev), your friendly bot here to help you solve bugs, answer questions, and guide you on your journey to becoming a contributor. I'm here while you wait for a human maintainer. Let's tackle this together! 🚀 <!-- Answer --> I found a similar closed issue where the timestamp in logs was behind despite correct timezone settings. The solution involved ensuring that the timezone environment variable in the `docker-compose.yaml` file is set correctly. You can modify the `LOG_TZ` environment variable to your desired timezone, such as "Asia/Shanghai" <sup>[[1]](https://github.com/langgenius/dify/issues/5421)</sup>. Additionally, there was a discussion about ensuring that the PostgreSQL database configuration file `postgresql.conf` has the correct timezone settings: ```plaintext log_timezone = 'Asia/Shanghai' timezone = 'Asia/Shanghai' ``` Also, make sure that the Docker container's timezone is set correctly by mapping the host's timezone files: ```yaml volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro ``` After making these changes, restart the application to apply the new settings <sup>[[2]](https://github.com/langgenius/dify/discussions/16440)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/909a70de-7075-43ac-a1fc-24f7eded3337?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/909a70de-7075-43ac-a1fc-24f7eded3337?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/909a70de-7075-43ac-a1fc-24f7eded3337?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/909a70de-7075-43ac-a1fc-24f7eded3337?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/909a70de-7075-43ac-a1fc-24f7eded3337?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/909a70de-7075-43ac-a1fc-24f7eded3337?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/909a70de-7075-43ac-a1fc-24f7eded3337?feedback_type=other)</sup>
Author
Owner

@imGiraffe commented on GitHub (Apr 20, 2025):

页面内设置呢

Image

@imGiraffe commented on GitHub (Apr 20, 2025): 页面内设置呢 ![Image](https://github.com/user-attachments/assets/98af0f87-072a-4bbc-9ba2-8c58bca7cb97)
Author
Owner

@adminxxt commented on GitHub (Apr 20, 2025):

可以了,谢谢

------------------ 原始邮件 ------------------
发件人: "langgenius/dify" @.>;
发送时间: 2025年4月21日(星期一) 上午8:56
@.
>;
@.@.@.***>;
主题: Re: [langgenius/dify] Timestamp in Logs is 12 Hours Behind Despite Correct Timezone (Issue #18379)

页面内设置呢

@.*** (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>
imGiraffe left a comment (langgenius/dify#18379)

页面内设置呢

@.*** (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>

@adminxxt commented on GitHub (Apr 20, 2025): 可以了,谢谢 ------------------&nbsp;原始邮件&nbsp;------------------ 发件人: "langgenius/dify" ***@***.***&gt;; 发送时间:&nbsp;2025年4月21日(星期一) 上午8:56 ***@***.***&gt;; ***@***.******@***.******@***.***&gt;; 主题:&nbsp;Re: [langgenius/dify] Timestamp in Logs is 12 Hours Behind Despite Correct Timezone (Issue #18379) 页面内设置呢 ***@***.*** (view on web) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: ***@***.***&gt; imGiraffe left a comment (langgenius/dify#18379) 页面内设置呢 ***@***.*** (view on web) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: ***@***.***&gt;
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13123