How can I format date in Odoo 8 QWeb report?

César picture César · Nov 21, 2014 · Viewed 17.1k times · Source

The date in my Sales Order is currently showing as:

Fecha: 21/11/2014 16:59:15 

I want to show something like this:

Fecha: Surco, 21 de Noviembre del 2014

I tried using t-esc with strftime but that doesn't work:

<span t-esc="o.date_order.strftime('%Y')" />

Answer

Sebastian picture Sebastian · Nov 24, 2014

Try using:

<span t-field="o.date_order" t-field-options='{"format": "d MMMM y"}'/>

Result: 21 Noviembre 2014