import datetimedef getdate(date): s_date = datetime.date(1899, 12, 31).toordinal() - 1 if isinstance(date, float): date = int(date) d = datetime.date.fromordinal(s_date + date) return d.strftime("%Y-%m-%d")print getdate(41400.0)
输出:2013-05-06
本文共 310 字,大约阅读时间需要 1 分钟。
import datetimedef getdate(date): s_date = datetime.date(1899, 12, 31).toordinal() - 1 if isinstance(date, float): date = int(date) d = datetime.date.fromordinal(s_date + date) return d.strftime("%Y-%m-%d")print getdate(41400.0)
输出:2013-05-06
转载于:https://www.cnblogs.com/bbcar/p/3396018.html