コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
9134 ビュー

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
3月 17
3215
2
2月 24
5381
2
9月 24
1895
2
7月 23
6275
1
6月 23
4304