从Excel读取出来的日期,发现是小数,怎么转成日期呢
import xlrd
book =xlrd.open_workbook("createOrder.xlsx")
sheet = book.sheet_by_index(0)
nrows = sheet.nrows
for i in range (1,nrows):
startDate = sheet.cell_value(i, 10)
startDate = xlrd.xldate.xldate_as_datetime(startDate, 0)
startDate = startDate.strftime('%Y-%m-%d') #即可转换为日期格式