diff options
Diffstat (limited to 'user_guide_src/source/helpers/date_helper.rst')
-rw-r--r-- | user_guide_src/source/helpers/date_helper.rst | 68 |
1 files changed, 1 insertions, 67 deletions
diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst index 6bc6c2b05..1f6b93cda 100644 --- a/user_guide_src/source/helpers/date_helper.rst +++ b/user_guide_src/source/helpers/date_helper.rst @@ -50,7 +50,7 @@ The following functions are available: :returns: MySQL-formatted date :rtype: string - This function is identical to PHP's `date() <http://php.net/manual/en/function.date.php>`_ + This function is identical to PHP's `date() <https://secure.php.net/manual/en/function.date.php>`_ function, except that it lets you use MySQL style date codes, where each code letter is preceded with a percent sign, e.g. `%Y %m %d` @@ -67,45 +67,6 @@ The following functions are available: If a timestamp is not included in the second parameter the current time will be used. -.. php:function:: standard_date([$fmt = 'DATE_RFC822'[, $time = NULL]]) - - :param string $fmt: Date format - :param int $time: UNIX timestamp - :returns: Formatted date or FALSE on invalid format - :rtype: string - - Lets you generate a date string in one of several standardized formats. - - Example:: - - $format = 'DATE_RFC822'; - $time = time(); - echo standard_date($format, $time); - - .. note:: This function is DEPRECATED. Use the native ``date()`` combined with - `DateTime's format constants - <https://secure.php.net/manual/en/class.datetime.php#datetime.constants.types>`_ - instead:: - - echo date(DATE_RFC822, time()); - - **Supported formats:** - - =============== ======================= ====================================== - Constant Description Example - =============== ======================= ====================================== - DATE_ATOM Atom 2005-08-15T16:13:03+0000 - DATE_COOKIE HTTP Cookies Sun, 14 Aug 2005 16:13:03 UTC - DATE_ISO8601 ISO-8601 2005-08-14T16:13:03+00:00 - DATE_RFC822 RFC 822 Sun, 14 Aug 05 16:13:03 UTC - DATE_RFC850 RFC 850 Sunday, 14-Aug-05 16:13:03 UTC - DATE_RFC1036 RFC 1036 Sunday, 14-Aug-05 16:13:03 UTC - DATE_RFC1123 RFC 1123 Sun, 14 Aug 2005 16:13:03 UTC - DATE_RFC2822 RFC 2822 Sun, 14 Aug 2005 16:13:03 +0000 - DATE_RSS RSS Sun, 14 Aug 2005 16:13:03 UTC - DATE_W3C W3C 2005-08-14T16:13:03+0000 - =============== ======================= ====================================== - .. php:function:: local_to_gmt([$time = '']) :param int $time: UNIX timestamp @@ -196,33 +157,6 @@ The following functions are available: $human = unix_to_human($now); $unix = human_to_unix($human); -.. php:function:: nice_date([$bad_date = ''[, $format = FALSE]]) - - :param int $bad_date: The terribly formatted date-like string - :param string $format: Date format to return (same as PHP's ``date()`` function) - :returns: Formatted date - :rtype: string - - This function can take a number poorly-formed date formats and convert - them into something useful. It also accepts well-formed dates. - - The function will return a UNIX timestamp by default. You can, optionally, - pass a format string (the same type as the PHP ``date()`` function accepts) - as the second parameter. - - Example:: - - $bad_date = '199605'; - // Should Produce: 1996-05-01 - $better_date = nice_date($bad_date, 'Y-m-d'); - - $bad_date = '9-11-2001'; - // Should Produce: 2001-09-11 - $better_date = nice_date($bad_date, 'Y-m-d'); - - .. note:: This function is DEPRECATED. Use PHP's native `DateTime class - <https://secure.php.net/datetime>`_ instead. - .. php:function:: timespan([$seconds = 1[, $time = ''[, $units = '']]]) :param int $seconds: Number of seconds |