aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/date.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/output/date.php')
-rw-r--r--views/default/output/date.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/views/default/output/date.php b/views/default/output/date.php
new file mode 100644
index 000000000..1644a3480
--- /dev/null
+++ b/views/default/output/date.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Date
+ * Displays a properly formatted date
+ *
+ * @package Elgg
+ * @subpackage Core
+ *
+ * @uses $vars['value'] Date as text or a Unix timestamp in seconds
+ */
+
+// convert timestamps to text for display
+if (is_numeric($vars['value'])) {
+ $vars['value'] = gmdate('Y-m-d', $vars['value']);
+}
+
+echo $vars['value'];