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())
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
0
lip 25
|
463 | ||
|
1
mar 25
|
1413 | ||
|
0
mar 24
|
963 | ||
|
0
lut 24
|
1154 | ||
|
2
lip 23
|
2916 |