File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
administrator/components/com_users/src/Model Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ public function formatRelative(?string $dateTimeText): string
127127 $ utcTimeZone = new \DateTimeZone ('UTC ' );
128128 $ jDate = new Date ($ dateTimeText , $ utcTimeZone );
129129 $ unixStamp = $ jDate ->toUnix ();
130+ $ app = Factory::getApplication ();
130131
131132 // I'm pretty sure we didn't have MFA in Joomla back in 1970 ;)
132133 if ($ unixStamp < 0 ) {
@@ -135,7 +136,7 @@ public function formatRelative(?string $dateTimeText): string
135136
136137 // I need to display the date in the user's local timezone. That's how you do it.
137138 $ user = $ this ->getCurrentUser ();
138- $ userTZ = $ user ->getParam ('timezone ' , ' UTC ' );
139+ $ userTZ = $ user ->getParam ('timezone ' , $ app -> get ( ' offset ' , ' UTC ') );
139140 $ tz = new \DateTimeZone ($ userTZ );
140141 $ jDate ->setTimezone ($ tz );
141142
You can’t perform that action at this time.
0 commit comments