summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers/date_helper.rst
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-20 14:35:50 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-20 14:35:50 +0100
commit160a4e5628aba8b5e35da784ec87037e133c1f05 (patch)
tree3ceec6e888a078bfe86ebfefe2e126f9b23f384f /user_guide_src/source/helpers/date_helper.rst
parentad97736d8249240cba802d33a24b7b11e02488cf (diff)
parent820999cb0d82c80d6dc5dde133568812c8113e29 (diff)
Merge upstream branch
Diffstat (limited to 'user_guide_src/source/helpers/date_helper.rst')
-rw-r--r--user_guide_src/source/helpers/date_helper.rst13
1 files changed, 8 insertions, 5 deletions
diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst
index f965e6166..bf7670734 100644
--- a/user_guide_src/source/helpers/date_helper.rst
+++ b/user_guide_src/source/helpers/date_helper.rst
@@ -255,14 +255,16 @@ Formats a unix timestamp so that is appears similar to this
The first parameter must contain a Unix timestamp. The second parameter
must contain a timestamp that is greater that the first timestamp. If
-the second parameter empty, the current time will be used. The most
-common purpose for this function is to show how much time has elapsed
-from some point in time in the past to now.
+the second parameter empty, the current time will be used. The third
+parameter is optional and limits the number of time units to display.
+The most common purpose for this function is to show how much time has
+elapsed from some point in time in the past to now.
-.. php:method:: timespan($seconds = 1, $time = '')
+.. php:method:: timespan($seconds = 1, $time = '', $units = '')
:param integer $seconds: a number of seconds
:param string $time: Unix timestamp
+ :param integer $units: a number of time units to display
:returns: string
Example
@@ -271,7 +273,8 @@ Example
$post_date = '1079621429';
$now = time();
- echo timespan($post_date, $now);
+ $units = 2;
+ echo timespan($post_date, $now, $units);
.. note:: The text generated by this function is found in the following language
file: language/<your_lang>/date_lang.php