Skip to content

Conversation

@KUMAKAIHA
Copy link

I modified the Dockerfile to include setting the TZ variable, with the default UTC timezone. I also edited telemetry_db.php to add a timestamp for timezone configuration. Additionally, PHP now defaults to using UTC as the timezone when no TZ variable is passed.
I compiled a test Docker on my Mac, and everything runs fine on my Mac. However, the version compiled on Mac is for arm64, but I believe it shouldn't have a big impact on the amd64 version. I only tried adding the timezone as Shanghai and got the correct timezone on the query page. I hope to get more tests to ensure the stability of the project.

@KUMAKAIHA KUMAKAIHA changed the title 使环境变量TZ在Docker中有效,并默认使用UTC时区 Make the environment variable TZ effective in Docker and default to using the UTC timezone. May 25, 2024
@sstidl sstidl added the Docker label Jul 31, 2024
@sstidl sstidl changed the base branch from update-build-pipeline to master July 31, 2024 20:25
Copy link
Collaborator

@sstidl sstidl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls remove .DS_Store

the timestamp col in sql is defined to insert current date-time. so it is not needed to set the timestamp in the insert statement.

@KUMAKAIHA
Copy link
Author

KUMAKAIHA commented Mar 17, 2025

pls remove .DS_Store>
the timestamp col in sql is defined to insert current date-time. so it is not needed to set the timestamp in the insert statement.

I am very sorry for uploading .DS_Store. Firstly, it was because I didn't know this hidden file is invisible in VSCode. Secondly, I was new to macOS at that time and didn't realize the system would create these files in every folder. So I have now deleted this file and updated the .gitignore file to prevent macOS users from continuing to upload .DS_Store. Regarding the date-time issue in SQL that you mentioned, I am not sure if this will affect MySQL, MSSQL, etc. However, the Docker version should be using SQLite by default. I tried modifying the system time inside the container and other methods, but I couldn't correct the database time. Therefore, I took a different approach by having PHP directly provide the correct timestamp to the database. As for normal deployment scenarios, I may need to investigate further and perhaps use other methods to correct the SQLite time. But at least in the current state, it supports Docker configuration of tz to use the correct local time, and I have already successfully tested it on a Debian server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants