Show Ghost Post Publish Date in Day Time with AM and PM Format
If you notice some news websites, you will see that they also show which hour the post was published, besides the published date.
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.