I should be able to use max()
with a datetimes list:
import sys, os, datetime
pre_dates = [row[0] for row in arcpy.da.SearchCursor(prelim, "PRE_DATE")]
....
>>>pre_dates = [[datetime.datetime(2017, 9, 15, 0, 0),
datetime.datetime(2017, 9, 15, 0, 0),datetime.datetime(2017, 10, 25, 0, 0),
datetime.datetime(2018, 19, 11, 0, 0),datetime.datetime(2017, 7, 6, 0, 0),
datetime.datetime(2017, 4, 15, 0, 0)]
date = max(pre_dates)
This seemed to work previously and several other answers to similar questions seemed to confirm this. Now it is throwing this error:
TypeError: 'int' object is not callable
What's the problem here? I need to get the max (or most current) date from this list of datetime dates and converting it using strftime('%m/%d/%y')
must be done afterwards. Any suggestions as to how to resolve this?