summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-07-07 09:11:21 +0000
committeralecpl <alec@alec.pl>2009-07-07 09:11:21 +0000
commitb6b593416bb1bef12c30b0cea8c92221d4b7a5c2 (patch)
tree5b3a9968a3f04d31f9d15d55ea440e6b06902447 /program/include
parent72cd3c1a761fad73235cad32f240a114ba2941aa (diff)
- Support strftime's format modifiers in date_* options (#1484806)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/main.inc3
1 files changed, 3 insertions, 0 deletions
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()