import datetime
with open('file.csv', 'w') as outputfile:
    for row in rows:
        wrtr = csv.writer(outputfile, delimiter=',', quotechar='"')
row[1] = row[1].strftime('%Y/%m/%d %H:%M')
Python csv writerows reformatting datetime to include seconds