From b81f909f8aaa3bedc3820c0d4c9056b57113b46e Mon Sep 17 00:00:00 2001 From: Roger Herbert Date: Mon, 12 Mar 2012 12:46:02 +0000 Subject: updated docs & changelog --- user_guide_src/source/helpers/date_helper.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'user_guide_src/source/helpers/date_helper.rst') diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst index ad06dd628..b21d147bd 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//date_lang.php -- cgit v1.2.3-24-g4f1b