- Timestamp:
- May 5, 2024 8:41:57 PM (2 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r812 r815 1958 1958 $format = $format ?: $this->getParam('lc_date_format'); 1959 1959 if ($format && mb_strpos($format, '%') !== false) { 1960 // The date format is localized for strftime(). It only accepts a timestamp, which are always in UTC, so we hack this by offering the date from the user's timezone in a format without a TZ specified, which is used to a make a timestamp for strftime (we can't use DaateTime->format('U') because that would convert the date back to UTC). 1961 return strftime($format, strtotime($dt->format('Y-m-d H:i:s'))); 1960 // The date format is localized for strftime(). It only accepts a timestamp, which are always in UTC, so we hack this by offering the date from the user's timezone in a format without a TZ specified, which is used to a make a timestamp for strftime (we can't use DateTime->format('U') because that would convert the date back to UTC). 1961 // FIXME: The strftime() function is deprecated as of PHP 8.1. 1962 // Consider replacing strftime() with a non-deprecated alternative like DateTime::format() or IntlDateFormatter for locale-specific formatting. 1963 return @strftime($format, strtotime($dt->format('Y-m-d H:i:s'))); 1962 1964 } else { 1963 1965 // Otherwise use a regular date format. … … 1980 1982 { 1981 1983 try { 1982 // Create a DateTime object and conver the timezone from server to user.1984 // Create a DateTime object and convert the timezone from server to user. 1983 1985 $dt = $this->convertTZ($datetime, $this->getParam('user_timezone'), $this->getParam('php_timezone')); 1984 1986 } catch (Exception $e) {
Note: See TracChangeset
for help on using the changeset viewer.