Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
9139 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona

Thank you, Sudhir Sir.

+1 from me.

thanks

Post correlati Risposte Visualizzazioni Attività
1
mar 17
3217
2
feb 24
5381
2
set 24
1898
2
lug 23
6275
1
giu 23
4307