且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查Excel单元格的格式在C#中,看看是否单元格的值是一个日期

更新时间:2023-11-29 13:07:46

Range.NumberFormat 应该帮助你确定给定格/范围被格式化为日期。如果单元格/范围日期格式然后NumberFormat属性将包含格式字符串,即DD / MM / YYYY

The Range.NumberFormat should help you determine if a given cell/range is formatted to a date. If the cell/range is date formatted then the NumberFormat property will contain the format string, i.e. dd/mm/yyyy