تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
7 الردود
10635 أدوات العرض

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
مارس 25
1266
0
يناير 25
3312
1
أغسطس 23
14626
change password تم الحل
1
أغسطس 23
13262
1
يوليو 23
10284