Use `DateTime::format()` instead of `DateUtil::format()`
authorCyperghost <olaf_schmitz_1@t-online.de>
Tue, 29 Oct 2024 11:53:05 +0000 (12:53 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Tue, 29 Oct 2024 11:53:05 +0000 (12:53 +0100)
wcfsetup/install/files/lib/system/box/TodaysBirthdaysBoxController.class.php

index 2373f62c174badd1dfea84975f2dd857d86b87ba..ff94dd97995fba3a2854773a7c8a44f1ded4efd9 100644 (file)
@@ -9,7 +9,6 @@ use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\condition\IObjectCondition;
 use wcf\system\user\UserBirthdayCache;
 use wcf\system\WCF;
-use wcf\util\DateUtil;
 
 /**
  * Shows today's birthdays.
@@ -88,8 +87,9 @@ class TodaysBirthdaysBoxController extends AbstractDatabaseObjectListBoxControll
     protected function loadContent()
     {
         // get current date
-        $currentDay = DateUtil::format(null, 'm-d');
-        $date = \explode('-', DateUtil::format(null, 'Y-n-j'));
+        $now = new \DateTimeImmutable("now", WCF::getUser()->getTimeZone());
+        $currentDay = $now->format('m-d');
+        $date = \explode('-', $now->format('Y-n-j'));
 
         // get user ids
         $userIDs = UserBirthdayCache::getInstance()->getBirthdays($date[1], $date[2]);