Skip to Content
Menu
This question has been flagged
4 Replies
1673 Views

Hello, 

I have this in odoo 10, how can i have the same thing in odoo 12?

<span t-esc="time.strftime('%d-%m-%Y', time.strptime(ddt.date,'%Y-%m-%d %H:%M:%S'))"
style="color:{{style.cust_color}};"/>
Thanks.
Avatar
Discard

Please use a meaningful title.

Convert datetime.date to datetime.datetime: https://goo.gl/VNJgWS

Best Answer

Hi Giusy, in version 12 the datetime field are python Date object, you don't have to use 

strptime.
Avatar
Discard
Author

I solved with <span t-esc="o.date_invoice.strftime('%d/%m/%Y')"/>

Author Best Answer

My problem is that I have to format the date in qweb ... I need to have the format day / month / year .. how can I do?

Avatar
Discard