diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2001-04-21 21:18:47 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2001-04-21 21:18:47 +0000 |
commit | 323c30e1dc6aaf2b42afb5e8fe8b4512af20da2a (patch) | |
tree | 8ab73bcbe3bbf54aa3a6a9caccc9b204075f563f /includes/function.inc | |
parent | d6554be78688b46bebcd2ac86224150d41a10fba (diff) | |
download | brdo-323c30e1dc6aaf2b42afb5e8fe8b4512af20da2a.tar.gz brdo-323c30e1dc6aaf2b42afb5e8fe8b4512af20da2a.tar.bz2 |
- Added "custom" date/time format... to allow user-timezone-adjusted custom date formats. I didn't add special logic to translate parts of it, but it's not really needed, as this is only meant for internal usage (e.g. checking if timestamp A is on the same date as timestamp B).
Some modules (such as diary) should be changed to take advantage of this function, as they are now still using GMT+0 dates in some cases (e.g. the recent diary entries box).
Diffstat (limited to 'includes/function.inc')
-rw-r--r-- | includes/function.inc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/includes/function.inc b/includes/function.inc index fe792d43c..c61ef635c 100644 --- a/includes/function.inc +++ b/includes/function.inc @@ -65,7 +65,7 @@ function format_interval($timestamp) { return ($output) ? $output : "0 sec"; } -function format_date($timestamp, $type = "medium") { +function format_date($timestamp, $type = "medium", $format = "") { global $user; $timestamp += ($user->timezone) ? $user->timezone - date("Z") : 0; @@ -80,6 +80,9 @@ function format_date($timestamp, $type = "medium") { case "large": $date = t(date("l", $timestamp)) .", ". t(date("F", $timestamp)) ." ". date("d, Y - H:i", $timestamp); break; + case "custom": + $date = date($format, $timestamp); + break; default: $date = t(date("l", $timestamp)) .", ". date("m/d/Y - H:i", $timestamp); } |