Commit d4d1522c authored by Dries's avatar Dries

- Patch #607896 by Benjamin Melançon, scor: add date_iso8601() function to...

- Patch #607896 by Benjamin Melançon, scor: add date_iso8601() function to common.inc. Part of the RDFa exception.
parent ef6a7dbb
......@@ -2279,6 +2279,22 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
return preg_replace_callback('/\xEF([AaeDlMTF]?)(.*?)\xFF/', '_format_date_callback', $format);
}
/**
* Returns an ISO8601 formatted date based on the given date.
*
* Can be used as a callback for RDF mappings.
*
* @param $date
* A UNIX timestamp.
* @return string
* An ISO8601 formatted date.
*/
function date_iso8601($date) {
// The DATE_ISO8601 constant cannot be used here because it does not match
// date('c') and produces invalid RDF markup.
return date('c', $date);
}
/**
* Callback function for preg_replace_callback().
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment