protected function DateTime::prepareDateValue in Feeds 8.3
Prepares a date value.
Parameters
string $value: The value to convert to a date.
Return value
string A formatted date, in UTC time.
2 calls to DateTime::prepareDateValue()
- DateRange::prepareValue in src/
Feeds/ Target/ DateRange.php - Prepares a single value.
- DateTime::prepareValue in src/
Feeds/ Target/ DateTime.php - Prepares a single value.
File
- src/
Feeds/ Target/ DateTime.php, line 48
Class
- DateTime
- Defines a datetime field mapper.
Namespace
Drupal\feeds\Feeds\TargetCode
protected function prepareDateValue($value) {
/** @var \Drupal\Core\Datetime\DrupalDateTime|null $date */
$date = $this
->convertToDate($value);
if (isset($date) && !$date
->hasErrors()) {
return $date
->format($this->storageFormat, [
'timezone' => DateTimeItemInterface::STORAGE_TIMEZONE,
]);
}
return '';
}