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

Hello;

Please, who knows how to compare to fields datetime in odoo v8.

Thanks a lot in advance

아바타
취소
베스트 답변

what about literal comparison

a < b

or

a > b

or 

a == b

?

아바타
취소

default date and datetime formats in odoo allow you to compare literally datetime or date strings and result of such comparison will correspond to the comparison of corresponding dates.

베스트 답변

You can use normal python datetime code to compare it.


Thanks.

아바타
취소
작성자

Please, what do you mean by use normal python datetime code. Can you give me an example please

베스트 답변

Follow this Link https://docs.python.org/2/library/datetime.html and read the python datetime doc

아바타
취소
작성자

Thanks a lot for the link

베스트 답변

Dear Drees Far,

I think this example may be use full

>>> from datetime import datetime

>>> past = datetime.now()

>>> present = datetime.now()

>>> past < present

True

>>> datetime(2012, 1, 1) > present

False

>>> present - datetime(2000, 4, 4)

datetime.timedelta(4242, 75703, 762105)

Regards,

Ankit H Gandhi

아바타
취소
관련 게시물 답글 화면 활동
0
3월 25
1422
0
1월 25
3506
1
8월 23
14870
change password 해결 완료
1
8월 23
13518
1
7월 23
10498