Skip to content

Show Ghost Post Publish Date in Day Time with AM and PM Format

Ahmad Ajmi Photo
Ahmad Ajmi

If you noticed in some news websites, you would see that they also show which hour the post was published beside the published date. This is useful for the reader to know what time this post was published. Let’s see how we can add this to your Ghost theme.

Let’s take an example and see how it works.

{{ date published_at format='h:mm A' }}

In this example, we passed the format filter to the published_at property. The h in the format filter means hour, the mm means minutes, and A means AM or PM. This example will give the following result.

10:02 PM

Suppose we want to show AM or PM in a lower case format. We can use a instead of A like the following example.

{{ date published_at format='h:mm a' }}
10:02 pm

If we want to combine this with the regular date format, we can use something like the following.

{{ date published_at }} - {{ date published_at format='h:mm A' }}

The result will be.

Mar 25, 2020 - 10:02 PM

I hope you find this useful.


Subscribe to Aspire Themes

You will receive Ghost resources, new themes, and updates.


Write more
Save time & money

Ghost CMS themes for a professional-looking website. Newsletter & membership full support.

Choose your theme »
  • Ghost 4 Support
  • Free Support & Updates
  • 100% Money Back Guarantee