Trying to format date with ordinal suffix

In that case, your output modifier snippet should be just one line:

return date("jS M Y", $input );

And the tag should be:

[[+publishedon:dateWithOrdinals]]

There’s no point in converting it to a human-readable date, then back to a timestamp when it’s a timestamp to begin with.

I would like to know why your example worked and not mine?

This is just a wild guess, but maybe getResources and pdoResources handle date fields differently, with one returning a human-readable date and the other a timestamp.

That wouldn’t explain why I got it to work with both getResources and pdoResources. That remains a mystery.

I think i have found the reason in the docks
https://docs.modx.pro/en/components/pdotools/quick-start
It works directly with database tables. This makes it faster. You don’t have to convert resources dates to timestamps before you can pass pass them to “date” output filter.
Thanks for all your help.

That confirms my suspicions. So, imo, pdoTools is handling date fields the way MODX should have to begin with.