Liquid – output a date with a numeric ordinal contraction "16th"

Is it possible to output a date with a numeric ordinal contraction? I tried the below but it seems to

{{ order.created_at | date: “%e %B, %Y” }}

That outputs 16 February, 2022 rather than 16th February 2022

Hi @jai-sandhu

Strftime is not support this format. But you can do it like this.

Kani_0-1664333338151.png

{% assign day = "now" | date: "%e"| modulo: 10 %}
{%- case day -%}
    {%- when 1 -%}
        {% assign suffix = 'st' %}
    {%- when 2 -%}
        {% assign suffix = 'nd' %}
    {%- when 3 -%}
        {% assign suffix = 'rd' %}
    {%- else -%}
        {% assign suffix = 'th' %}
{%- endcase -%}
{{ "now" | date: "%e[S] %B, %Y" | replace: '[S]',suffix }}

Strftime is not supported in* this format