diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2001-05-17 17:56:52 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2001-05-17 17:56:52 +0000 |
commit | daee55e0ec62894a4d43ef48a7e4f64dc57d4a16 (patch) | |
tree | a107e8c582478d46f52bef1561c9480a298b7baf /includes | |
parent | 30c236f22b760d8e312062a9a286843fecb70480 (diff) | |
download | brdo-daee55e0ec62894a4d43ef48a7e4f64dc57d4a16.tar.gz brdo-daee55e0ec62894a4d43ef48a7e4f64dc57d4a16.tar.bz2 |
Updated the custom timestamp format to include locale support.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 8 |
1 files changed, 7 insertions, 1 deletions
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); |