def find_date_range(self):
date_min = datetime.max
date_max = datetime.min
for tweet in self.get_collection_iterators():
date_to_process = datetime.strptime(tweet['created_at'],'%a %b %d %H:%M:%S +0000 %Y')
if date_to_process <= date_min:
date_min = date_to_process
if date_to_process >= date_max:
date_max = date_to_process
return {"date_min":date_min,"date_max":date_max}
评论列表
文章目录