summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-28 08:43:03 +0100
committerAndrew Dolgov <[email protected]>2005-11-28 08:43:03 +0100
commitbe773442d23f8038549f23ed012101a86270451c (patch)
tree122a404857ee4564cadacf301a165a754614818b /functions.php
parent63186cdb788724f02e8401e9f3b2f1d57ba438b3 (diff)
option HEADLINES_SMART_DATE
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index f0077efae..7a09b9d86 100644
--- a/functions.php
+++ b/functions.php
@@ -737,4 +737,24 @@
return null;
}
}
+
+ function smart_date_time($timestamp) {
+ if (date("Y.m.d", $timestamp) == date("Y.m.d")) {
+ return date("G:i", $timestamp);
+ } else if (date("Y.m", $timestamp) == date("Y.m")) {
+ return date("M d, G:i", $timestamp);
+ } else {
+ return date("Y/m/d G:i");
+ }
+ }
+
+ function smart_date($timestamp) {
+ if (date("Y.m.d", $timestamp) == date("Y.m.d")) {
+ return "Today";
+ } else if (date("Y.m", $timestamp) == date("Y.m")) {
+ return date("D m", $timestamp);
+ } else {
+ return date("Y/m/d");
+ }
+ }
?>