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


I am trying to use date objects.

And i want to extract the month from this field.

Please who can help me i need it please.

아바타
취소
베스트 답변

from datetime import datetime

from openerp.tools import DEFAULT_SERVER_DATE_FORMAT

......

month = date_field and datetime.strptime(date_field, DEFAULT_SERVER_DATE_FORMAT).month

......

아바타
취소
관련 게시물 답글 화면 활동
2
5월 22
34157
0
3월 19
4188
0
1월 19
5254
4
2월 24
12508
0
1월 18
4031