I am getting Invalid input datetime format of value '11/22/2018' when setting special price in magento 2.3.1.
-
Is this form date or to date? – Rutvee Sojitra May 16 '19 at 10:03
-
it is in from date – Ansar Husain May 16 '19 at 10:05
-
Actually i have set same thing in both filed with magento's same version but not getting any issue – Rutvee Sojitra May 16 '19 at 10:06
-
use multi store? – Savan Patel May 16 '19 at 10:11
-
no @SavanPatel only single store – Ansar Husain May 16 '19 at 10:12
This is an official bug. See Magento / GitHub thread here!
@jcdennen shows a temporary fix until Magento fix it by modifying the Timezone.php file and removing am and adding a 0 in $date .= " 0:00am"
Composer Install: vendor/magento/framework/Stdlib/DateTime/Timezone.php
Other Install: lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php
from:
private function appendTimeIfNeeded($date, $includeTime)
{
if ($includeTime && !preg_match('/\d{1}:\d{2}/', $date)) {
$date .= " 0:00am";
}
return $date;
}
To:
private function appendTimeIfNeeded($date, $includeTime)
{
if ($includeTime && !preg_match('/\d{1}:\d{2}/', $date)) {
$date .= ' 00:00';
}
return $date;
}
Just remember that modifying core files will be overwritten with an update.
Still not resolved by Magento in M2.3.2.