title: Does xlrd retrieve date variables correctly from Excel?
body: <p>I was trying to read a multiple sheet Excel workbook into SPSS when I stumbled upon the following problem: when I read a date variable from Excel into Python with xlrd, it seems to add 2 days to the date. Or perhaps my conversion from the Excel format to a more human friendly representation is not correct. Could anybody tell me what's wrong in the code below?</p>
  
  <pre><code>import xlwt,datetime 
  wb=xlwt.Workbook() 
  ws=wb.add_sheet("date_1") 
  fmt = xlwt.easyxf(num_format_str='M/D/YY') 
  ws.write(0,0,datetime.datetime.now(),fmt) 
  wb.save(r"d:\temp\datetest.xls") 
  
  #Now open Excel file manually -&gt; date is correct
  
  import xlrd
  wb=xlrd.open_workbook(r"d:\temp\datetest.xls") 
  ws=wb.sheets()[0]
  Data = ws.row_values(0)[0]
  print datetime.datetime(1900,1,1,0,0,0)+datetime.timedelta(days=Data)
  
  #Now date is 2 days off
  </code></pre>