- Patch #607896 by Benjamin Melançon, scor: add date_iso8601() function to common.inc. Part of the RDFa exception.
parent
ef6a7dbbc0
commit
d4d1522c3e
|
@ -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().
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue