Hi Raymond
The following is my experiences to put python3 variable data into SOAR date time picker fields.
Given that you use
python3
SOAR date time picker fields: start_time, end_time
Script is like this:
from datetime import datetime, timedelta
end_time = datetime.fromisoformat('2024-10-08T00:00:000+07:00')
start_time = end_time - timedelta(days=7)
incident.properties.start_time = int(start_time.timestamp()*1000)
incident.properties.end_time = int(end_time.timestamp()*1000)
To put python variable data into a SOAR date time picker field, there are some points:
1. convert python variable data from datetime fields to timestamp() object (msec)
2. Then result data should be multiplied with 1000 to convert to microsecond order. (with decimal point)
3. Since SOAR date time picker field only accept integer, convert decimal point to integer.
------------------------------
Yohji Amano
------------------------------