Finding unique dates

I have a dataset about deliveries, with a datetime in the format yyyy-mm-dd hh:mm:ss (for example: "29-2-2020 13:31:00"). Now I wan't to count the number of unique days in the set. I tried using cardinality in combination with a 'format': "yyyy-MM-dd", but this is not working. Can someone tell me how to get just the days?

This is what I have so far

search_body = {
'aggs': {
'type_count': {
'cardinality': {
'field': 'dropoff_datetime'
}
}
}
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.