Skip to content

Show Ghost Post Times in AM/PM Format

By Ahmad Ajmi

Some news websites show a post’s time as well as its date. You can show both in Ghost.

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

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

We passed the format option to the published_at property in this example. The h in the format option 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.

More from the Blog

Latest Ghost Themes