From daee55e0ec62894a4d43ef48a7e4f64dc57d4a16 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Thu, 17 May 2001 17:56:52 +0000 Subject: Updated the custom timestamp format to include locale support. --- includes/common.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index baa14a591..a83645b54 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -131,7 +131,13 @@ function format_date($timestamp, $type = "medium", $format = "") { $date = t(date("l", $timestamp)) .", ". t(date("F", $timestamp)) ." ". date("d, Y - H:i", $timestamp); break; case "custom": - $date = date($format, $timestamp); + for ($i=strlen($format);$i>=0;$c=$format[--$i]) { + if (strstr("DFlMSw",$c)) + $date=t(date($c,$timestamp)).$date; + else if (strstr("AaBdgGhHiIjLmnrstTUYyZz",$c)) + $date=date($c,$timestamp).$date; + else $date=$c.$date; + } break; default: $date = t(date("l", $timestamp)) .", ". date("m/d/Y - H:i", $timestamp); -- cgit v1.2.3