This outputs something like: “Voting is closed at this time. Vote at 23rd of August, for the third day of the competition, from 21:00 a.m until 20:00 a.m of the next day”.
I know it looks bad! What is the best way to insert these variables?
Thanks. Putting a.m/p.m was silly! Also, I can’t seem to find how to set the locale.
I have 'date.handler' => 'strftime' in my config, a date field, and I am outputting it like this: <?= strftime('%A', $results_datetime->toDate()) ?>. This outputs the day’s name in English no matter the language selected.
If the date handler is set, and locale in config, you output a date like this:
<?php
$format = '%e %B'; // e.g. 23 August, whatever format you need here, the format can also be taken from your list of translations if you need different formats per language
echo $page->date()->toDate($format);
Edit: If you are in a multi-lang environment, the locale is set in your language files, not need to set it in config.