Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
9171 Widoki

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')" />

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć

Thank you, Sudhir Sir.

+1 from me.

thanks

Powiązane posty Odpowiedzi Widoki Czynność
1
mar 17
3245
2
lut 24
5381
2
wrz 24
1924
2
lip 23
6326
1
cze 23
4334