From 691eaf1f13b838452beb85f706319d20f61f0848 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 3 Feb 2009 23:04:31 +0000 Subject: [PATCH] Respect time zone when displaying autosave and revision time. Props janbrasna, designsimply. fixes #8750 #6489 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@10490 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-ajax.php | 2 +- wp-includes/functions.php | 6 +++--- wp-includes/post-template.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 3de51754b..6bab931dc 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -842,7 +842,7 @@ case 'autosave' : // The name of this action is hardcoded in edit_post() $do_lock = true; $data = ''; - $message = sprintf( __('Draft Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) ); + $message = sprintf( __('Draft Saved at %s.'), date_i18n( __('g:i:s a') ) ); $supplemental = array(); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 0087b4205..ec4a02f43 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -46,13 +46,13 @@ function mysql2date( $dateformatstring, $mysqlstring, $translate = true ) { * The 'mysql' type will return the time in the format for MySQL DATETIME field. * The 'timestamp' type will return the current timestamp. * - * If the $gmt is set to either '1' or 'true', then both types will use the - * GMT offset in the WordPress option to add the GMT offset to the time. + * If $gmt is set to either '1' or 'true', then both types will use GMT time. + * if $gmt is false, the output is adjusted with the GMT offset in the WordPress option. * * @since 1.0.0 * * @param string $type Either 'mysql' or 'timestamp'. - * @param int|bool $gmt Optional. Whether to use $gmt offset. Default is false. + * @param int|bool $gmt Optional. Whether to use GMT timezone. Default is false. * @return int|string String if $type is 'gmt', int if $type is 'timestamp'. */ function current_time( $type, $gmt = 0 ) { diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 6b648d003..7e640f39d 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -1191,7 +1191,7 @@ function wp_post_revision_title( $revision, $link = true ) { $autosavef = __( '%s [Autosave]' ); $currentf = __( '%s [Current Revision]' ); - $date = date_i18n( $datef, strtotime( $revision->post_modified_gmt . ' +0000' ) ); + $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) ) $date = "$date";