1

I want to add date picker in admin form which display 24 hour format. Currently , I select date then it will display like 4/25/17 5:21 PM

But I want to display like this 2017年04月25日 17:21:00

How to do it?

Please help me....

Thanks in advance.... :)

$fieldset->addField(
 'from_date',
 'date',
 [
 'name' => 'from_date',
 'label' => __('From'),
 'title' => __('From'),
 /*'date_format' => 'yyyy-MM-dd',
 'time_format' => 'hh:mm:ss'*/
 'date_format' => $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT),
 'time_format' => $this->_localeDate->getTimeFormat(\IntlDateFormatter::SHORT),
 ]
 );
asked May 3, 2017 at 6:21

1 Answer 1

4

Change it to:

'date_format' => \Magento\Framework\Stdlib\DateTime::DATE_INTERNAL_FORMAT,
'time_format' => 'HH:mm:ss',

Hope it helps :)

answered Sep 15, 2017 at 7:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.