Remove timezone from date display if known and can display in user's time.

This commit is contained in:
Retro_Guy 2024-11-12 08:17:31 -07:00
parent 96f62762d6
commit cfc4b35892
2 changed files with 7 additions and 7 deletions

View File

@ -1431,11 +1431,11 @@ function get_date_for_client_timezone($date)
} else { } else {
$offset = intval($CONFIG['timezone']); $offset = intval($CONFIG['timezone']);
} }
if (isset($_COOKIE['tzid']) && (isset($OVERRIDES['timezone_to_local_format']) && $OVERRIDES['timezone_to_local_format'] == 'timezone')) { if (isset($_COOKIE['tzid']) && (isset($OVERRIDES['timezone_to_local_format']) && $OVERRIDES['timezone_to_local_format'] == 'none')) {
$datetime = new DateTime(date($text_header["date_format"], $date)); $datetime = new DateTime(date($text_header["date_format"], $date));
$client_time = new DateTimeZone($_COOKIE['tzid']); $client_time = new DateTimeZone($_COOKIE['tzid']);
$datetime->setTimezone($client_time); $datetime->setTimezone($client_time);
$displaydate = $datetime->format('D, j M Y H:i T'); $displaydate = $datetime->format('D, j M Y H:i');
} else { } else {
$datetime = new DateTime(date($text_header["date_format"], $date), new DateTimeZone('UTC')); $datetime = new DateTime(date($text_header["date_format"], $date), new DateTimeZone('UTC'));
$datetime->add(DateInterval::createFromDateString($offset . ' minutes')); $datetime->add(DateInterval::createFromDateString($offset . ' minutes'));

View File

@ -78,12 +78,12 @@ return [
// Default is true // Default is true
'quote_blank_lines' => true, 'quote_blank_lines' => true,
// Show timezone converted to local (client) time as // Show timezone converted to local (client) time as
// 'offset' (-0400) or 'timezone' (EST) // 'offset' (-0400) or 'none' (no timezone display)
// Default is 'offset', which should be more reliable // Default is 'offset'
// as 'timezone' may have issues with daylight savings time // 'none' will display NO timezone for dates in articles
'timezone_to_local_format' => 'offset', 'timezone_to_local_format' => 'offset',
// How to format 'who wrote' quoting in reply: // How to format 'who wrote' quoting in reply:
// 'On 4, Jan 2024, John Doe wrote:' // 'On 4, Jan 2024, John Doe wrote:'
// Options are: // Options are: