Hi Ricardo
I think this is what you are looking for:
from pprint import pprint, pformat
from datetime import datetime, timedelta
days_ago = 30
# get a date object for x number of days ago
date_x_days_ago = datetime.now() - timedelta(days=days_ago)
# find users by checking the user's projects field
versions = shotgun.find("Version",
[["project.Project.id", "is", 89],
["updated_at", "less_than", date_x_days_ago]],
["code", "updated_at"])
pprint(versions)
It’s not whole days, it’s using the current time as well so you would get a split of versions on that day depending what time you run this script at and when the versions were created. You could alter the datetime object though so you always went from midnight or something though.
Best
Phil