[b]安装lib[/b]
[b]有关excel时间的转换[/b]
可参考:
[url]http://blog.donews.com/limodou/archive/2005/07/08/459100.aspx[/url]
easy_install xlrd
def handle(path):
book = open_workbook(path)
sheet = book.sheet_by_index(0)
print sheet.name
print sheet.nrows
print sheet.ncols
for row_index in range(sheet.nrows):
for col_index in range(sheet.ncols):
prinf sheet.cell(row_index,col_index).value
[b]有关excel时间的转换[/b]
可参考:
[url]http://blog.donews.com/limodou/archive/2005/07/08/459100.aspx[/url]
__s_date = datetime.date(1899, 12, 31).toordinal() - 1
def getdate(date):
if isinstance(date, float):
date = int(date)
d = datetime.date.fromordinal(__s_date + date)
return d.strftime("%Y-%m-%d")