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

getting default timezone for local time #49087

Merged

Conversation

AIlkiv
Copy link
Contributor

@AIlkiv AIlkiv commented Nov 5, 2024

Summary

In the server/lib/base.php file of the Nextcloud server, UTC is always set as the default timezone:

if (!date_default_timezone_set('UTC')) {

The main argument for this choice seems to be to simplify log reading, as discussed in this issue: #3553.

However, this hardcoding of UTC affects all instances where date_default_timezone_get is used, resulting in UTC even when it would be more intuitive to use the server's timezone or the one set in config.php under default_timezone.

This pull request resolves an issue in the contact menu where the timezone was unexpectedly set to UTC. The fix aligns with other parts of the system that correctly retrieve the default timezone by leveraging similar logic:

https://github.com/search?q=org%3Anextcloud+%22%3EgetDefaultTimeZone%28%22&type=code

image

TODO

  • ...

Checklist

@AIlkiv AIlkiv force-pushed the getting-default-timezone-for-local-time branch from a333f15 to 3d2f2e4 Compare November 5, 2024 09:38
Signed-off-by: Andrii Ilkiv <a.ilkiv.ye@gmail.com>
@AIlkiv AIlkiv force-pushed the getting-default-timezone-for-local-time branch from 3d2f2e4 to 1ab1bbd Compare November 5, 2024 17:58
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Makes sense to use default_timezone here 👍

Thank you very much

@nickvergessen
Copy link
Member

This pull request resolves an issue in the contact menu where the timezone was unexpectedly set to UTC. The fix aligns with other parts of the system that correctly retrieve the default timezone by leveraging similar logic:

A login of that user should fix the problem

@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 9, 2024
@skjnldsv skjnldsv merged commit 8ff3f21 into nextcloud:master Nov 9, 2024
164 of 167 checks passed
Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feedback-requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants