콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
9240 화면

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
3299
2
2월 24
5381
2
9월 24
2061
2
7월 23
6510
1
6월 23
4414