【问题标题】:How to convert from Python date to Excel date using xlrd (attribute xlrd.xldate_from_date_tuple does not exist)如何使用 xlrd 将 Python 日期转换为 Excel 日期(属性 xlrd.xldate_from_date_tuple 不存在)
【发布时间】:2013-01-24 10:15:55
【问题描述】:

如何使用 xlrd 模块将 Python 日期转换为 Excel 日期? How to convert a python datetime.datetime to excel serial date number 建议使用“手动”解决方案,我想知道这是否是最好的方法。

Xlrd document 建议使用xlrd.xldate_from_date_tuple

但是

>>> import xlrd
>>> xlrd.xldate_from_date_tuple
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'xldate_from_date_tuple'

你能帮忙吗?谢谢。

【问题讨论】:

标签: python excel date xlrd


【解决方案1】:

使用xlrd.xldate.xldate_from_date_tuple

【讨论】:

    猜你喜欢
    • 2015-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-20
    • 1970-01-01
    • 2012-06-15
    相关资源
    最近更新 更多