Localized Date Format for Custom Field

I’m using a custom field, formatted with “dd-mm-yyyy”. I would like to use it with the Date Format defined in the Dashboard settings.

It seems alright in English with

Read More
get_option('date_format');

Or manually in French with

setlocale(LC_ALL, 'fr_FR');
$date_local = strftime("%d-%m-%Y",$date->format('U'));

But is there a way to use the localized date format of wordpress? I can’t find how to give the date as an argument to

the_date()

Related posts

Leave a Reply

1 comment