How to use ``xlrd.xldate_as_tuple()``

后端 未结 5 1213
情话喂你
情话喂你 2020-12-03 05:05

I am not quite sure how to use the following function:

xlrd.xldate_as_tuple

for the following data

xldate:39274.0
xldate:39         


        
5条回答
  •  醉话见心
    2020-12-03 05:39

    Here's what I use to automatically convert dates:

    cell = sheet.cell(row, col)
    value = cell.value
    if cell.ctype == 3:  # xldate
        value = datetime.datetime(*xlrd.xldate_as_tuple(value, workbook.datemode))
    

提交回复
热议问题