Dates usually arrive as text, like "2026-03-09". To do date math, turn the text into a datetime with strptime and a format that describes the text:
from datetime import datetime, timedelta
opened = datetime.strptime("2026-03-09 14:30", "%Y-%m-%d %H:%M")
%Y is a 4-digit year, %m the month, %d the day, %H:%M hours and minutes, and %b a short month name like Mar. .date() keeps just the date.
Subtracting two dates or datetimes gives a timedelta. Its .days gives whole days, and .total_seconds() the full length in seconds; divide by 3600 for hours. Watch out: .seconds is only the part left over after the whole days.
Add timedelta(days=30) to move a date forward. .weekday() gives 0 for Monday up to 6 for Sunday, and .strftime("%d %b %Y") turns a date back into text.