Skip to Content
Menu
This question has been flagged
6 Replies
16864 Views

I have a one datetime field called start_date.

If i fill the  start_date, it will show the date, hour, minute and seconds. eg (09/06/2017 12:55:49)

But i want to show only date, hour, minute and not need seconds. eg (09/06/2017 12:55)

Is there any possibility to show date, hour and minute in datetime field in odoo 10?.

Avatar
Discard
Best Answer

There is another option for Odoo v13, maybe, add t-options='{"widget": "date"}'

Avatar
Discard
Best Answer

You'll want to format your date field in the view, if you're inheriting a view you can do:

        <field name="start_date" position="attributes">
<attribute name="t-options">{"format": "dd / MM / yyyy HH / mm"}</attribute> </field>


Note that the `HH` may need to be `hh`, i'm not 100% sure on that one.
Avatar
Discard
Author

Hi Peter,

Thanks. But I am not inheriting a view. I write a new view with state_date datetime field.

Could you please tell me any widgets to solve this problem.

Hi Priyait, then simply define the attribute on your field like so:

<field name="start_date" t-options="{'format': 'dd / MM / yyyy HH / mm'}"/>

Author

Hi Peter,

I defined attribute on the field, but it still not working.

this code will not worked