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

Ensure that TZ setting can work properly in Docker. #612

Closed
wants to merge 4 commits into from

Conversation

KUMAKAIHA
Copy link

Added TZ variable and default TZ variable to Shanghai, providing the variable time zone to the container.
Then I modified the results/telemetry_db. php, which first attempts to obtain the value of TZ from the environment variable. If successfully obtained (i.e. environment variable exists), use this value to set the default time zone for PHP. If the TZ environment variable does not exist, choose to set the default time zone ('Asia/Shanghai ')
To ensure that the data written to the table by SQLite does indeed match the modified time (i.e. the actual time of the set time zone), I explicitly set the value of the timestamp field to the current time zone when inserting data into the speedtest_users table. This tested perfectly in my Docker and everything was fine on my x86 Ubuntu 22.04.4 LTS server. I hope to test and merge this.

@sstidl
Copy link
Collaborator

sstidl commented Apr 15, 2024

Thank you for your contribution

Please set the default time zone to UTC as this is common practice for global tine.

Also it would be nice to store all times in UTC and convert them on display only. This way it could be achieved that times are always correct for the viewer.

Thank you again
Stefan

was an accident. sorry. but we got a freshdocker image without php8 bugs this way ;-)
to ensure docker image updates, we build the image once a week
@KUMAKAIHA
Copy link
Author

感谢您的贡献

请将默认时区设置为 UTC,因为这是全球时段的常见做法。

此外,最好将所有时间都存储在 UTC 中并仅在显示时转换它们。通过这种方式,可以实现时间对观众来说总是正确的。

再次感谢斯蒂芬

I apologize for the misunderstandings I had regarding Forking, committing, and merging on VSCode and GitHub. This confusion may have stemmed from inaccurate Chinese translations. When I attempted to submit changes on VSCode, it seemed like I was pushing my entire localization project to the original repository.

I have now tried to pull the latest version, made separate commits for the changes related to the TZ setting, and have successfully set UTC as the default timezone. Thank you for pointing out the errors. You can now try rebuilding and testing the Docker to confirm the effectiveness of the TZ variable. If my commits are still incorrect, please close this request. I will refork and seek assistance from GPT4 to help me submit the changes.

Thank you once again for your guidance.
KUMAKAIHA

@KUMAKAIHA KUMAKAIHA marked this pull request as ready for review April 15, 2024 22:30
@sstidl sstidl deleted the branch librespeed:dev May 18, 2024 19:51
@sstidl sstidl closed this May 18, 2024
@sstidl
Copy link
Collaborator

sstidl commented May 24, 2024

@KUMAKAIHA i'm sorry, i deleted the dev branch so your PR was closed. could you please resubmit if you have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants