Displays correct date in my timezone with the following tweaks:
I edited around line 234 of DashboardWidget.php as follows…
echo '<ul class="', esc_attr(implode(' ', $listClasses)), '"><tbody>';
$f = 'F j, Y @ g:ia';
foreach ($lines as $line) {
printf(
'<li class="elm-entry%s" data-raw-message="%s">%s <p class="elm-timestamp" title="%s">%s</p>',
!empty($line['stacktrace']) ? ' elm-has-stack-trace' : '',
esc_attr($line['message']),
$actions,
// !empty($line['timestamp']) ? gmdate('Y-m-d H:i:s e', $line['timestamp']) : '',
!empty($line['timestamp']) ? date($f, $line['timestamp']) : '',
// !empty($line['timestamp']) ? $this->plugin->formatTimestamp($line['timestamp']) : ''
!empty($line['timestamp']) ? date($f, $line['timestamp']) : ''
);
echo '<p class="elm-log-message">',
esc_html($this->plugin->formatLogMessage($line['message'])),
'</p>';
if ( !empty($line['stacktrace']) ) {
$this->displayStackTrace($line['stacktrace']);
}
echo '</li>';
}
echo '</ul>';
…and in my functions.php added…
add_filter('date_i18n', 'wpse57195_filter_date', 10, 4);
function wpse57195_filter_date($date, $format, $timestamp, $gmt)
{
if(!is_admin()) { return $date; }
date_default_timezone_set('America/New_York');
// if(!get_query_var('sitemap')) return $date;
// if this isn't a sitemap page, bail
// W3C Time format with -05:00 for central time
// NOTE: this doesn't account for daylight saving time
$f = 'F j, Y @ g:ia';
return $gmt ? gmdate($f, $timestamp) : date($f, $timestamp);
}