I'm stuck.I have field.date contract_start ,field.selection contract_duration and field.char contract_expired.What i want is when a person chooses a date they want their contract to start and for how long they want their contract to last, contract_expired get the date for when the contract ends.
此問題已被標幟
1
回覆
4117
瀏覽次數
Hi Zlatt,
You can calculate the expiration date by adding the duration to the start date. In Python, you can use the datetime module for this:
pythonCopy codefrom datetime import timedelta contract_start = # Your contract start date contract_duration = # Your selected duration, e.g. 3 (for 3 months) contract_expired = contract_start + timedelta(days=30 * contract_duration)
This will give you the date when the contract will expire.
Regards,
Team Ksolves!
| 相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
|---|---|---|---|---|
|
|
1
3月 21
|
6268 | ||
|
|
1
10月 25
|
652 | ||
|
|
2
6月 26
|
19741 | ||
|
|
0
7月 20
|
4909 | ||
|
|
1
7月 19
|
9493 |