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 {
$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));
$client_time = new DateTimeZone($_COOKIE['tzid']);
$datetime->setTimezone($client_time);
$displaydate = $datetime->format('D, j M Y H:i T');
$displaydate = $datetime->format('D, j M Y H:i');
} else {
$datetime = new DateTime(date($text_header["date_format"], $date), new DateTimeZone('UTC'));
$datetime->add(DateInterval::createFromDateString($offset . ' minutes'));

View File

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