protected function DateTestCase::iso8601 in Microdata 7
Converts date to ISO format
1 call to DateTestCase::iso8601()
- DateTestCase::testMarkup in modules/
date/ date.test - Tests whether microdata is correctly outputted, depending on the field formatter type.
File
- modules/
date/ date.test, line 129 - Tests for Date module.
Class
- DateTestCase
- Test Date module microdata placement.
Code
protected function iso8601($time = FALSE) {
if ($time === FALSE) {
$time = time();
}
$date = date('Y-m-d\\TH:i:sO', $time);
return substr($date, 0, strlen($date) - 2) . ':' . substr($date, -2);
}