diff --git a/packages/block-library/src/post-date/index.php b/packages/block-library/src/post-date/index.php index e185a995f6fc2..3e79855aa25b7 100644 --- a/packages/block-library/src/post-date/index.php +++ b/packages/block-library/src/post-date/index.php @@ -23,8 +23,14 @@ function render_block_core_post_date( $attributes, $content, $block ) { $post_ID = $block->context['postId']; if ( isset( $attributes['format'] ) && 'human-diff' === $attributes['format'] ) { - // translators: %s: human-readable time difference. - $formatted_date = sprintf( __( '%s ago', 'gutenberg' ), human_time_diff( get_post_timestamp( $post_ID ) ) ); + $post_timestamp = get_post_timestamp( $post_ID ); + if ( $post_timestamp > time() ) { + // translators: %s: human-readable time difference. + $formatted_date = sprintf( __( '%s from now', 'gutenberg' ), human_time_diff( $post_timestamp ) ); + } else { + // translators: %s: human-readable time difference. + $formatted_date = sprintf( __( '%s ago', 'gutenberg' ), human_time_diff( $post_timestamp ) ); + } } else { $formatted_date = get_the_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID ); }