1
votes

The date in my Invoice is currently showing as:

21/11/2014 16:59:15

I want to show just month something like this:

11

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

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

2 Answers

0
votes

Try This.

<span t-esc="datetime.datetime.strptime(o.sale_id.confirmation_date, '%Y-%m-%d %H:%M:%S').strftime('%B %d,%Y')"/>

My Output is: May 28,2018

Hope, It will be use.

2
votes

Try:

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

More on supported format patterns.