standard_date()

standard_date([$fmt = 'DATE_RFC822'[, $time = NULL]])

Parameters:
  • $fmt (string) – Date format
  • $time (int) – UNIX timestamp
Returns:

Formatted date or FALSE on invalid format

Return type:

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 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
doc_CodeIgniter
2016-10-15 16:32:40
Comments
Leave a Comment

Please login to continue.