Title: Localised time format (strftime) for posts
Last modified: August 18, 2016

---

# Localised time format (strftime) for posts

 *  [chtito](https://wordpress.org/support/users/chtito/)
 * (@chtito)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/localised-time-format-strftime-for-posts/)
 * I’d like to be able to use the (localised) strftime formatting for the titles
   of the blogs. That would allow titles like: Monday, December 23rd.
 * In fact i did it myself on my blog. The only thing to do is to modify the functions
   mysqltodate in “functions.php” and the_date in “template-functions-general.php”
   by adding a supplementary boolean argument, say “use_local”.
 * Once these functions are modified you just have to put something like the_date(‘%
   A %e %B %G’,'<h2>’,'</h2>’, 1, 1); for the title of each post.
 * Can this feature be added in wordpress?
 * Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/localised-time-format-strftime-for-posts/#post-125199)
 * chtito, ever thought of sticking your changes into a plugin?
 *  Thread Starter [chtito](https://wordpress.org/support/users/chtito/)
 * (@chtito)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/localised-time-format-strftime-for-posts/#post-125398)
 * Yes, you’re right!! Here is the plugin (it’s too simple to be made a general 
   purpose plugin, imo). I didn’t use the strftime function because the right locale
   is very difficult to get. It requires to have the date in the ISO format, like
   2005-01-13. So here is the code:
    ` function frenchMonth($n) {
 *  $months = array("janvier", "fÃ©vrier",
    "mars", "avril", "mai", "juin", "juillet","
   aoÃ»t", "septembre", "octobre", "novembre","dÃ©cembre"); return $months[$n-1];}
 * function frenchWeekday($d)
    { $days = array("Dimanche", "Lundi", "Mardi", "Mercredi","
   Jeudi", "Vendredi", "Samedi"); return $days[$d]; }
 * function localTimeFilter($theDate)
    { if (empty($theDate)) return $theDate; $
   date = explode("-",$theDate); $phptime = mktime(0,0,0,$date[1], $date[2], $date[
   0]);
 *  return "<h2>".frenchWeekday(date("w", $phptime))." ".date("j", $phptime)." ".
   frenchMonth(date("n", $phptime))." ".date("Y", $phptime)."</h2>";
    //return "
   <h2>".strftime("%A %e %B %G", $phptime)."</h2>"; }
 * add_filter("the_date", "localTimeFilter");
 * enjoy!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Localised time format (strftime) for posts’ is closed to new replies.

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 2 replies
 * 2 participants
 * Last reply from: [chtito](https://wordpress.org/support/users/chtito/)
 * Last activity: [21 years, 5 months ago](https://wordpress.org/support/topic/localised-time-format-strftime-for-posts/#post-125398)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
