感谢
if data:
header = data[0]
adjust_payroll_period_date_index = header.index('adjust_payroll_period_date')
for index, line in enumerate(data):
if index == 0:
continue
adjust_payroll_period_date = line[adjust_payroll_period_date_index]
if not (adjust_payroll_period_date and '/Date(' in adjust_payroll_period_date):
continue
adjust_payroll_period_date = adjust_payroll_period_date.split('+')[0].split('(')[1].split(')')[0]
adjust_payroll_period_date = (int(adjust_payroll_period_date) / 1000)
adjust_payroll_period_date = datetime.fromtimestamp(adjust_payroll_period_date)
adjust_payroll_period_date = adjust_payroll_period_date.strftime('%Y-%m')
line[adjust_payroll_period_date_index] = adjust_payroll_period_date