Changeset 815 for trunk/lib/App.inc.php


Ignore:
Timestamp:
May 5, 2024 8:41:57 PM (13 days ago)
Author:
anonymous
Message:

Minor fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r812 r815  
    19581958        $format = $format ?: $this->getParam('lc_date_format');
    19591959        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')));
    19621964        } else {
    19631965            // Otherwise use a regular date format.
     
    19801982    {
    19811983        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.
    19831985            $dt = $this->convertTZ($datetime, $this->getParam('user_timezone'), $this->getParam('php_timezone'));
    19841986        } catch (Exception $e) {
Note: See TracChangeset for help on using the changeset viewer.