Definition at line 12 of file Date.php.
◆ __construct()
Construct
- Parameters
-
DateTime | $dateTime | |
TimezoneInterface | $localeDate | |
ScopeConfigInterface | $scopeConfig | |
Definition at line 36 of file Date.php.
41 $this->dateTime = $dateTime;
42 $this->localeDate = $localeDate;
43 $this->scopeConfig = $scopeConfig;
◆ formatDate()
formatDate |
( |
|
$storeId, |
|
|
|
$date = null |
|
) |
| |
Retrieve date value in elasticsearch format (ISO 8601) Example: 1995-12-31T23:59:59
- Parameters
-
int | $storeId | |
string | null | $date | |
- Returns
- string|null @SuppressWarnings(PHPMD.UnusedFormalParameter)
Definition at line 55 of file Date.php.
57 if ($this->dateTime->isEmptyDate($date)) {
60 $dateObj = new \DateTime($date,
new \DateTimeZone(
'UTC'));
61 return $dateObj->format(
'c');
The documentation for this class was generated from the following file:
- vendor/magento/module-elasticsearch/Model/Adapter/FieldType/Date.php