0

I am getting Invalid input datetime format of value '11/22/2018' when setting special price in magento 2.3.1.

enter image description here

12
  • Is this form date or to date? May 16, 2019 at 10:03
  • it is in from date May 16, 2019 at 10:05
  • Actually i have set same thing in both filed with magento's same version but not getting any issue May 16, 2019 at 10:06
  • use multi store? May 16, 2019 at 10:11
  • no @SavanPatel only single store May 16, 2019 at 10:12

1 Answer 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.