-
Notifications
You must be signed in to change notification settings - Fork 98
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
(fix) default timezone for export #2397
(fix) default timezone for export #2397
Conversation
I fully agree, exports are data and thus should be UTC for convenience, so you can do what ever you like afterwards with it while you are processing the data. |
ok, also the import of OCA\DAV? this will introduce another dependency on an app. Is there no OCP import available for that? |
0582821
to
500d69e
Compare
Signed-off-by: Andrii Ilkiv <[email protected]>
500d69e
to
cb611e8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2397 +/- ##
=======================================
Coverage ? 42.86%
Complexity ? 851
=======================================
Files ? 72
Lines ? 3203
Branches ? 0
=======================================
Hits ? 1373
Misses ? 1830
Partials ? 0 |
/backport to stable4 |
In the server/lib/base.php file of the Nextcloud server, UTC is always set as the default timezone:
https://github.com/nextcloud/server/blob/4a44d6a6774d79a8c91cab5f94acafa271b6d4d6/lib/base.php#L609
The main argument for this choice seems to be to simplify log reading, as discussed in this issue: nextcloud/server#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 corrects the timestamp values in export files, aligning them with the expected timezone settings. The fix is informed by the solutions implemented in other parts of the system where similar timezone issues are handled, as seen in references like:
https://github.com/search?q=org%3Anextcloud+%22%3EgetDefaultTimeZone%28%22&type=code