3

In Magento2 : When I saved date attribute with time is the same picture below. After I saved it only save date and get no time.
Any know reason and how to fix it? enter image description here

In database: after saved

enter image description here

When I changed format from \Magento\Framework\Stdlib\DateTime\Filter\Date to \Magento\Framework\Stdlib\DateTime\Filter\DateTime and then I got:

Recoverable Error: Argument 7 passed to Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper::__construct() must be an instance of Magento\Framework\Stdlib\DateTime\Filter\DateTime, none given, called in
D:\xampp\htdocs\magento\var\generation\Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\Interceptor.php on line 15 and defined in <br>
D:\xampp\htdocs\magento\vendor\magento\module-catalog\Con`troller\Adminhtml\Product\Initialization\Helper.php on line 57

2 Answers 2

2

Check your database whether your column is date type or date-time type.If it is date type then it only saves date not time but if your column type is of date-time then it saves date and time both.

0

in database if we are taken datetime filed then also updating date only not time. time takig

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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