diff --git a/includes/templates/class-amp-post-template.php b/includes/templates/class-amp-post-template.php index bdabf61b057..3bcab0db0f8 100644 --- a/includes/templates/class-amp-post-template.php +++ b/includes/templates/class-amp-post-template.php @@ -305,7 +305,7 @@ private function build_post_publish_timestamp() { $format = 'U'; if ( empty( $this->post->post_date_gmt ) || '0000-00-00 00:00:00' === $this->post->post_date_gmt ) { - $timestamp = time(); + $timestamp = (int) get_the_time('U'); } else { $timestamp = (int) get_post_time( $format, true, $this->post, true ); } diff --git a/templates/meta-time.php b/templates/meta-time.php index 40c173beb73..77193b64be8 100644 --- a/templates/meta-time.php +++ b/templates/meta-time.php @@ -26,7 +26,7 @@ sprintf( /* translators: %s: the human-readable time difference. */ __( '%s ago', 'amp' ), - human_time_diff( $this->get( 'post_publish_timestamp' ), time() ) + human_time_diff( $this->get( 'post_publish_timestamp' ), current_time('timestamp') ) ) ); ?>