I want to change the date format for admin in Sales->Order(view order)->Invoices tab in 24H format

enter image description here

I tried to find how this grid is rendered and i found(with template path hinth) that this table is rendered in vendor\magento\module-ui\view\base\ui_component\templates\listing\default.xhtml.

    data-bind="scope: '{{getName()}}.{{getName()}}'"
    <div data-role="spinner" data-component="{{getName()}}.{{getName()}}.{{spinner}}" class="admin__data-grid-loading-mask">
        <div class="spinner">
    <!-- ko template: getTemplate() --><!-- /ko -->

And from here some KO js files are loaded. I am not god at KO js and I don't know how can I do this?

Does anyone know how can I change this date format?

1 Answer 1


To change any date to 24 format in SALES menu:

override /vendor/magento/module-sales/view/adminhtml/ui_component/ xml that you need and add:<item name="dateFormat" xsi:type="string">MMM dd, YYYY, HH:mm:ss </item> for the date filed.

As an example:

  <column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">dateRange</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
                    <item name="dataType" xsi:type="string">date</item>
                    <item name="label" xsi:type="string" translate="true">Created</item>
                    <item name="dateFormat" xsi:type="string">MMM dd, YYYY, HH:mm:ss </item>

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.