CMS Development

jjokinen
Colaborador

Custom 'Updated' Time Stamp for Blog Posts

resolver

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 Soluciones aceptada
Gonzalo
Solución
Colaborador líder | Partner nivel Diamond
Colaborador líder | Partner nivel Diamond

Custom 'Updated' Time Stamp for Blog Posts

resolver

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

Ver la solución en mensaje original publicado

6 Respuestas 6
Gonzalo
Solución
Colaborador líder | Partner nivel Diamond
Colaborador líder | Partner nivel Diamond

Custom 'Updated' Time Stamp for Blog Posts

resolver

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
Administrador de la comunidad
Administrador de la comunidad

Custom 'Updated' Time Stamp for Blog Posts

resolver

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


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


jjokinen
Colaborador

Custom 'Updated' Time Stamp for Blog Posts

resolver

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
Administrador de la comunidad
Administrador de la comunidad

Custom 'Updated' Time Stamp for Blog Posts

resolver

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


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


0 Me gusta
TitiCuisset
Administrador de la comunidad
Administrador de la comunidad

Custom 'Updated' Time Stamp for Blog Posts

resolver

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


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


Gonzalo
Colaborador líder | Partner nivel Diamond
Colaborador líder | Partner nivel Diamond

Custom 'Updated' Time Stamp for Blog Posts

resolver

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