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')" />
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
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')" />
Hello
You can use as below:
<span t-esc="datetime.datetime.strptime(o.date_order, '%Y-%m-%d').strftime('%m')"/>Note: Date format must match with the format of the date_order.
Thanks
Thank you, Sudhir Sir.
+1 from me.
thanks
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|  | 1 मार्च 17  | 3651 | ||
|  | 2 फ़र॰ 24  | 5381 | ||
|  | 2 सित॰ 24  | 2852 | ||
|  | 2 जुल॰ 23  | 7750 | ||
|  | 1 जून 23  | 5160 |