I have created a product with custom options like below. One of the fields is a date field. I have modified the date option (date.phtml) to show the time choice on the date-picker. However, because the option is declared as a date not showing the time in the dashboard by default.

Pick-up Date-Time Option

When a customer place an order the date appears without the time details like below.

Missing Time in order details

How could I change the date format to display the time on items options in order details? I don't want to use the default time option of Magento because doesn't allow us to set restrictions. I want to have an option with DateTime picker.

Many thanks

1 Answer 1



$date = $this->_localeDate->date(new \DateTime($yourDate))->format('Y/m/d H:i:s');
  • Thanks for you reply. Could you please provide me with more details where to apply the change?
    – Nick M.
    Commented Jan 31, 2021 at 21:08
  • Is this a third-party module ???
    – Himanshu
    Commented Feb 1, 2021 at 5:31

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.