Odoo Help

0

How two compare two fields datetime??

By
Drees Far
on 7/13/15, 4:52 AM 1,053 views

Hello;

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

Thanks a lot in advance

0

Temur

--Temur--
2932
| 6 5 7
Tbilisi, Georgia
--Temur--
Programmer
Temur
On 7/13/15, 6:58 AM

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.

Temur
on 7/13/15, 7:02 AM
0

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
1091
| 5 3 6
Rajkot, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 7/26/15, 6:51 AM

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
ahmad
On 7/13/15, 5:05 AM

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

Drees Far
on 7/13/15, 5:56 AM
0
Dairidi
On 7/13/15, 5:25 AM

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

Thanks a lot for the link

Drees Far
on 7/13/15, 5:55 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 7/13/15, 4:52 AM
Seen: 1053 times
Last updated: 7/28/15, 9:45 AM