when I try to read a datetime value from an excel sheet, it returns a double value. For example, if you want to read the value '2007-02-19 14:11:45.730' like this, I get a double type value. Next, I convert this double value using timespan, but not completely successfully, because I only get this value '2007-02-19 12:00:00 AM'
Now I want the exact same date and time value as the first. My code is like: -
TimeSpan datefromexcel = new TimeSpan(Convert.ToInt32((range.Cells[rCnt, cCnt] as Excel.Range).Value2), 0, 0, 0); DateTime inputdate = new DateTime(1900, 1, 1).Add(datefromexcel); arrrow2[cCnt - 1] = inputdate.ToString();
Please, help!!! Thank.
c # excel office-interop
Pranav Dec 27 '10 at 11:19 2010-12-27 11:19
source share