From b6b593416bb1bef12c30b0cea8c92221d4b7a5c2 Mon Sep 17 00:00:00 2001 From: alecpl Date: Tue, 7 Jul 2009 09:11:21 +0000 Subject: - Support strftime's format modifiers in date_* options (#1484806) --- program/include/main.inc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'program/include/main.inc') diff --git a/program/include/main.inc b/program/include/main.inc index 5ff5f499b..d8b832844 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -893,6 +893,9 @@ function format_date($date, $format=NULL) else if (!$format) $format = $CONFIG['date_long'] ? $CONFIG['date_long'] : 'd.m.Y H:i'; + // strftime() format + if (preg_match('/%[a-z]+/i', $format)) + return strftime($format, $timestamp); // parse format string manually in order to provide localized weekday and month names // an alternative would be to convert the date() format string to fit with strftime() -- cgit v1.2.3