Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
9142 Tampilan

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
Buang
Jawaban Terbai

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
Buang

Thank you, Sudhir Sir.

+1 from me.

thanks

Post Terkait Replies Tampilan Aktivitas
1
Mar 17
3221
2
Feb 24
5381
2
Sep 24
1904
2
Jul 23
6280
1
Jun 23
4311