-
Notifications
You must be signed in to change notification settings - Fork 206
Open
Description
Currently we are limited by hour,day,week,month,year but often minute is very helpful to allow being more granular.
One use case is to query all events that were produced in the last 5 minutes
'in_last' [[int], 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR']
# note that brackets are not literal (eg. ['start_date', 'in_last', 1, 'DAY'])
'in_next' [[int], 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR']
# note that brackets are not literal (eg. ['start_date', 'in_next', 1, 'DAY'])
for those that need minutes until the api supports it
import datetime
from datetime import timezone
# Get current time in UTC (which Shotgrid API uses)
now = datetime.datetime.now(timezone.utc)
# Calculate timestamp for minutes ago
minutes_ago = now - datetime.timedelta(minutes=minutes)
filters = [
['created_at', 'greater_than', minutes_ago], # Use timestamp directly
]
Thanks!
Metadata
Metadata
Assignees
Labels
No labels