I’m struggling to understand why this is not querying the versions between the two given dates? I’m using python. what am i doing wrong here?
My goal is to query all versions within a start and end date. I personally don’t care about the hour, minute, second. Just the start of one day and the end of the second day. Give me all the verions
def queryVersions():
filters = [
['project', 'is', {'type': 'Project', 'id': projectId}],
['updated_at', 'between',
[
datetime.datetime(2020,5,14,0,0,0).strftime('%Y-%m-%dT%H:%M:%SZ'),
datetime.datetime(2020,5,15,1,0,0).strftime('%Y-%m-%dT%H:-%M:%SZ')
]
],
['user', 'is', {'type': 'HumanUser', 'id': 441}] # matt
]
results = sg.find('Version', filters, ['code', 'user', 'updated_at'])
print len(results)
pprint.pprint(results, indent=3)
I tried this and it also does not work…
def queryVersions():
startDate = datetime(2020, 5, 14, 0, 0, 0).utcnow()
endDate = datetime(2020, 5, 15, 0, 0, 0).utcnow()
print startDate, endDate
filters = [
['project', 'is', {'type': 'Project', 'id': projectId}],
['updated_at', 'between',
[
startDate,
endDate
]
],
['user', 'is', {'type': 'HumanUser', 'id': 441}] # matt lef
]
results = sg.find('Version', filters, ['code', 'user', 'updated_at'])
print len(results)
pprint.pprint(results, indent=3)