Forum

Thread tagged as: Question

Add Ordinals after date HTML

Hi guys,

I'm trying to set my dates up like this:

16th December

So far, I'm able to get 16 December but I'm unable to add the ordinals afterwards (the 'th', 'nd', 'th', 'rd'). I've found the thread discussing doing this through PHP but I need to know if it's possible through HTML?

My (relevant) code so far:

<p class="entry-published date"><perch:blog id="postDateTime" format="%d %B" /></p>

Thanks! Harry

Harry Ray

Harry Ray 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

strftime doesn't support ordinals, so assuming you only need English language use date() instead. Perch supports both options https://php.net/manual/en/function.date.php

Duncan Revell

Duncan Revell 78 points
Registered Developer

https://docs.grabaperch.com/templates/field-types/date/

Check the link to PHP date formats in the docs above...