diff --git a/lib/Service/SubmissionService.php b/lib/Service/SubmissionService.php index 8df23779b..42c3bb1ce 100644 --- a/lib/Service/SubmissionService.php +++ b/lib/Service/SubmissionService.php @@ -207,7 +207,7 @@ public function getSubmissionsData(Form $form, string $fileFormat, ?File $file = $submissionEntities = array_reverse($submissionEntities); $questions = $this->questionMapper->findByForm($form->getId()); - $defaultTimeZone = date_default_timezone_get(); + $defaultTimeZone = $this->config->getSystemValueString('default_timezone', 'UTC'); if (!$this->currentUser) { $userTimezone = $this->config->getUserValue($form->getOwnerId(), 'core', 'timezone', $defaultTimeZone); diff --git a/tests/Unit/Service/SubmissionServiceTest.php b/tests/Unit/Service/SubmissionServiceTest.php index 07f71e2a3..55ac37d76 100644 --- a/tests/Unit/Service/SubmissionServiceTest.php +++ b/tests/Unit/Service/SubmissionServiceTest.php @@ -579,7 +579,11 @@ private function setUpCsvTest(array $questions, array $submissions, string $csvT return $questionEntities; })); - date_default_timezone_set('Europe/Berlin'); + $this->config->expects($this->once()) + ->method('getSystemValueString') + ->with('default_timezone', 'UTC') + ->willReturn('Europe/Berlin'); + $this->config->expects($this->once()) ->method('getUserValue') ->with('currentUser', 'core', 'timezone', 'Europe/Berlin')