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
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())
Create an account today to enjoy exclusive features and engage with our awesome community!
Přihlásit se| Related Posts | Odpovědi | Zobrazení | Aktivita | |
|---|---|---|---|---|
|
0
srp 25
|
2028 | |||
|
1
bře 25
|
3392 | |||
|
0
led 26
|
2106 | |||
|
0
úno 24
|
2393 | |||
|
2
čvc 23
|
4363 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.