CMS Development

AlixOfCanada
Member

Blog is showing current date instead of published date.

SOLVE

Hi Everyone 🙂

I'm having this issue where when viewing blogs, the date reflects the current date and not the actual published date. I have another line of code temporarily in to preview, and it shows a completely wrong date.  While viewing a blog archive, everything is correct.

 

Any tips?

Thanks.

 

Design Manager view of template used for individual blogsDesign Manager view of template used for individual blogs

0 Upvotes
1 Accepted solution
webdew
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Blog is showing current date instead of published date.

SOLVE

Hi @AlixOfCanada ,

 Please use the below snippet to display actual published date
  <div class="blog-post__meta">
        <time datetime="{{ content.publish_date }}" class="blog-post__timestamp">
{{ content.publishDate|datetimeformat('%B %e, %Y') }}

        </time>
      </div>

Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regard.

View solution in original post

0 Upvotes
3 Replies 3
webdew
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Blog is showing current date instead of published date.

SOLVE

Hi @AlixOfCanada ,

 Please use the below snippet to display actual published date
  <div class="blog-post__meta">
        <time datetime="{{ content.publish_date }}" class="blog-post__timestamp">
{{ content.publishDate|datetimeformat('%B %e, %Y') }}

        </time>
      </div>

Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regard.

0 Upvotes
jonchim
Guide | Diamond Partner
Guide | Diamond Partner

Blog is showing current date instead of published date.

SOLVE

Hey @AlixOfCanada, I believe on certain of the older templates, i've noticed that with blogs they used to have a default date that wasn't the publish date. But once it was published it would show the correct date on the frontend. Are you looking at a preview link of the post or the live link?






Jon Chim
VP of Design & Development
Hypha HubSpot Development


check Did my post help answer your query? Help the Community by marking it as a solution
0 Upvotes
AlixOfCanada
Member

Blog is showing current date instead of published date.

SOLVE

Hey 🙂

Here's an example of what one of our posted blogs looks like. Note that this screenshot is outside the preview and the blog was actually posted on the 18th.

Screen Shot 2021-10-22 at 9.15.56 AM.png

0 Upvotes