Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
9157 Vues

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
Ignorer
Meilleure réponse

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
Ignorer

Thank you, Sudhir Sir.

+1 from me.

thanks

Publications associées Réponses Vues Activité
1
mars 17
3228
2
févr. 24
5381
2
sept. 24
1909
2
juil. 23
6284
1
juin 23
4317