CMS Development

jjokinen
Contributeur

Custom 'Updated' Time Stamp for Blog Posts

Résolue

Hi!

 

I found this article on the subject but seems like the actual code snippet is missing from there. Does anybody have the snippet available for sharing?

 

https://blog.hubspot.com/customers/writing-a-custom-updated-timestamp-for-blog-posts

 

Thanks in advance!

 

Joel

1 Solution acceptée
Gonzalo
Solution
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

Custom 'Updated' Time Stamp for Blog Posts

Résolue

If you are looking to display the last updated date instead of the published date on a post page you can use the following:

{{ content.updated|datetimeformat('%B %e, %Y') }}

 

 

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting

Voir la solution dans l'envoi d'origine

6 Réponses
Gonzalo
Solution
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

Custom 'Updated' Time Stamp for Blog Posts

Résolue

If you are looking to display the last updated date instead of the published date on a post page you can use the following:

{{ content.updated|datetimeformat('%B %e, %Y') }}

 

 

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting
TitiCuisset
Gestionnaire de communauté
Gestionnaire de communauté

Custom 'Updated' Time Stamp for Blog Posts

Résolue

Hi @jjokinen 

 

Thank you for reaching out. I have reached out to the team for this missing part. 

 

As for your question, wondering if some of our top experts would already have the answer - @Kevin-C @DanielSanchez @Gonzalo do you have any thoughts on that for @jjokinen ? 

 

Thank you!

Best

Tiphaine


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!

jjokinen
Contributeur

Custom 'Updated' Time Stamp for Blog Posts

Résolue

Hi @TitiCuisset,

 

Thanks! Did you hear anything back from the team?

And thanks @Gonzalo for the snippet! Would you use that in the exact same way as the article instructs? 

TitiCuisset
Gestionnaire de communauté
Gestionnaire de communauté

Custom 'Updated' Time Stamp for Blog Posts

Résolue

Hey @jjokinen 

 

Thank you for your reply

 

The team is looking into it but I haven't gotten an update just yet, I'll share that here once I have!

 

Thank you

Best

Tiphaine


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!

0 Votes
TitiCuisset
Gestionnaire de communauté
Gestionnaire de communauté

Custom 'Updated' Time Stamp for Blog Posts

Résolue

Hi @jjokinen 

 

Apologies for the delay here. Got an update from the team, the snippet in the blog post would be: 

{% set update_time = content.updated %}
{% set offset = <your offset> %}
{% set new_time = update_time + offset %}

 

Thank you!

Best

Tiphaine


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!

Gonzalo
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

Custom 'Updated' Time Stamp for Blog Posts

Résolue

If the time is important in your context then yes, you would want to customize the date format filter adding the time and follow the post to replace for the right timezone, otherwise I would say is not that important 🙂

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting