Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
9170 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 17
3241
2
ก.พ. 24
5381
2
ก.ย. 24
1920
2
ก.ค. 23
6318
1
มิ.ย. 23
4330