تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
9140 أدوات العرض

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 17
3217
2
فبراير 24
5381
2
سبتمبر 24
1898
2
يوليو 23
6275
1
يونيو 23
4307