The server time in not matching with current time as per the India 
timezone. and I want to compare the server time with my newly added 
float field.The problem is float field come like 10.5 and could not compare it with my datetime field.
Is there any solution for this?
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
the server timezone may not match the local server time while comparing time.Please check the below code.
from datetime import timedelta
current_time = str(datetime.now() + timedelta(hours=5.5)) # '2022-05-13 13:37:45.063621'
            current_time = current_time[11:16] # str 13:37
            current_time = float(current_time.replace(":", "."))  # float  13.37
----------------------------
if current_time > your_float_field:# 8.25 > 8.0 # Checking the time with float field.
Hope it will be useful for you.
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل| المنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
|---|---|---|---|---|
|  | 0 يناير 25  | 3767 | ||
|  | 2 أكتوبر 25  | 245 | ||
|  | 1 أكتوبر 25  | 5653 | ||
|  | 3 سبتمبر 25  | 1908 | ||
|  | 2 سبتمبر 25  | 3079 | 
