WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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()
share|improve this question
up vote 1 down vote accepted

actually I found the answer right after posting:

date_i18n(get_option('date_format') ,$timestamp);

it was in an example here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.