主题
Date1904 (属性)
如果工作簿使用 1904 日期系统,则该属性值为 True。bool 类型,可读写。
示例
python
#本示例使 ET 对活动工作簿使用 1904 日期系统
def test():
Application.ActiveWorkbook.Date1904 = True
python
#本示例分别演示在关闭和启用 Date1904 日期系统下1904年1月1日的序列号
def test():
if not ActiveWorkbook.Date1904:
ActiveCell.Value2 = "1904年1月1日"
print(f"未启用1904日期系统:{ActiveCell.Value()} 的序列号为 {ActiveCell.Value2}")
ActiveWorkbook.Date1904 = True
ActiveCell.Value2 = "1904年1月1日"
print (f"启用1904日期系统:{ActiveCell.Value()}的序列号为 {ActiveCell.Value2}")