![](/img/trans.png)
[英]How to get a date from year, month, week of month and Day of week ? C#
[英]How to get the date in day month year from date value
我正在使用具有日期数据的Excel上传操作。 当我上传日期为2012年10月17日的excel时,我得到41199。
您需要通过使用DateTime.FromOADate将日期格式从OLE自动化转换为.net格式。
double doubleValue = double.Parse(b);
DateTime convertedDate = DateTime.FromOADate(doubleValue );
public static DateTime FromExcelSerialDate(int serialDate){return new DateTime(1899, 12, 31).AddDays(serialDate);}
或其他解决旧问题的方法;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.