You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dashboard shows for today the date of yesterday. It looks like this is a problem with date_i18n which is just a legacy wrapper for wp_date since WP 5.3.
The user tested it with date_i18n( get_option( ‘date_format’ ), strtotime( $visit[‘date’] ) );
First reported here: https://wordpress.org/support/topic/date-one-day-behind-in-dashboard/
The dashboard shows for today the date of yesterday. It looks like this is a problem with
date_i18n
which is just a legacy wrapper forwp_date
since WP 5.3.The user tested it with
date_i18n( get_option( ‘date_format’ ), strtotime( $visit[‘date’] ) );
Which shows the wrong date. And:
wp_date( get_option( ‘date_format’ ), strtotime( $visit[‘date’] ) );
Which shows the correct date (for the site with the problem and a site without the problem).
See also:
https://developer.wordpress.org/reference/functions/date_i18n/
https://developer.wordpress.org/reference/functions/wp_date/
https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/
Function is used here:
https://github.com/pluginkollektiv/statify/blob/master/views/widget-front.php#L25
and here:
https://github.com/pluginkollektiv/statify/blob/master/views/widget-front.php#L108
The text was updated successfully, but these errors were encountered: