Respect time zone when displaying autosave and revision time. Props janbrasna, designsimply. fixes #8750 #6489 for 2.7

git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-02-03 23:06:17 +00:00
parent 3fa855d060
commit 3d8cd59bcb
3 changed files with 5 additions and 5 deletions

View File

@ -723,7 +723,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();

View File

@ -79,13 +79,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 ) {

View File

@ -1048,7 +1048,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 = "<a href='$link'>$date</a>";