Converting Timespan to DateTime in C# -


i reading excel worksheet data using c# , microsoft.office.interop. sheet contains date values. when trying read value giving number (probably timespan). having problem converting number datetime.

below code:

timespan ts = timespan.parse(((range)ws.cells[4, 1]).value2.tostring()); 

where ws excel.worksheet.

can explain how should convert number (timespan) datetime?

thanks sharing valuable time.

you following

double d = double.parse(((range)ws.cells[4, 1]).value2.tostring());  datetime conv = datetime.fromoadate(d); 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -