function _webform_csv_data_date in Webform 7.4
Same name and namespace in other branches
- 5.2 components/date.inc \_webform_csv_data_date()
- 5 components/date.inc \_webform_csv_data_date()
- 6.3 components/date.inc \_webform_csv_data_date()
- 6.2 components/date.inc \_webform_csv_data_date()
- 7.3 components/date.inc \_webform_csv_data_date()
Implements _webform_csv_data_component().
File
- components/
date.inc, line 585 - Webform module date component.
Code
function _webform_csv_data_date($component, $export_options, $value) {
if ($value[0]) {
$timestamp = webform_strtotime($value[0]);
if (!empty($export_options['iso8601_date'])) {
// ISO 8601 date: 2004-02-12.
$format = 'Y-m-d';
}
else {
$format = webform_date_format('short');
}
return format_date($timestamp, 'custom', $format, 'UTC');
}
else {
return '';
}
}