-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Make the environment variable TZ effective in Docker and default to using the UTC timezone. #628
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
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 |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
@KUMAKAIHA please look over all sql files and edit because you changed the schema (added a new column) |
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.