UNIX Time on Comments Creating Invalid Structured Data
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘UNIX Time on Comments Creating Invalid Structured Data’ is closed to new replies.
The topic ‘UNIX Time on Comments Creating Invalid Structured Data’ is closed to new replies.
(@cruzely)
6 years ago
I just noticed that for the past month that Google Search Console is showing warning for my AMP pages with comments on them. Digging in, it seems to be an issue with the fact that the timestamp for the comments is like this:
<time itemprop=”datePublished” datetime=”1577735324″>December 30, 2019 at 1:48 pm</time>
That gives this sort of error:
datePublished
1577735324 (Cannot understand the value 1577735324 as a date/time. Learn more about date/time formats.)
Looking at my Theme Editor in WordPress, I see this on the comments section:
}
$td_article_date_unix = @strtotime(“{$comment->comment_date_gmt} GMT”);
?>
<li class=”comment <?php echo esc_attr( $td_isPingTrackbackClass ) ?>” id=”comment-<?php comment_ID() ?>”>
<article>
<footer>
<?php echo get_avatar($td_comment_auth_email, 50) ?>
<cite><?php comment_author_link() ?></cite>
“>
<time pubdate=”<?php echo esc_attr( $td_article_date_unix ) ?>”><?php comment_date() ?> at <?php comment_time() ?></time>
Is there a way to adjust this to where it shows the time in a different way that AMP likes?