Could you please give an exact/complete code for finds date difference in days. The idea is we are using membership module and we want to display still how many days remain before membership expires.
Thank you
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Could you please give an exact/complete code for finds date difference in days. The idea is we are using membership module and we want to display still how many days remain before membership expires.
Thank you
You can use this date difference.
from datetime import datetime,date,timedelta
from dateutil.relativedelta import relativedelta
today = datetime.now()
today_str = today.strftime("%Y-%m-%d")
diff = relativedelta(datetime.strptime(today_str,'%Y-%m-%d').date(),datetime.strptime(your_date,'%Y-%m-%d').date())
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 8 25
|
689 | ||
|
1
thg 3 25
|
1729 | ||
|
0
thg 3 24
|
1102 | ||
|
0
thg 2 24
|
1334 | ||
|
2
thg 7 23
|
3086 |