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

Ahmad Ajmi Photo
Ahmad Ajmi

If you noticed some news websites, you would see that they also show which hour the post was published beside the published date. 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' }}

We passed the format filter to the published_at property in this example. 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 lowercase. We can use a instead of A, like in the following example.

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

We can use the following if we want to combine this with the regular date format.

{{ 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 helpful.

Subscribe to Aspire Themes

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

Write more
Save time & money

Ghost themes that are simple to use and easily customizable. Choose a theme for your blog, newsletter, podcast, portfolio, or news website.

Choose your theme →
  • Ghost 5.0 Support
  • Free Support & Updates
  • 100% Money Back Guarantee