This project has moved. For the latest updates, please go here.

Weird time data addition

Dec 19, 2011 at 2:33 AM

The data is provided as a string. The format of the incoming data is 8:30:45 which has to be interpreted as hrs:min:ss. There are 1000s of these string values. Forex:

08:00:14
08:32:49
08:40:04
08:30:01
08:34:50
07:19:51
08:05:03
0
07:32:48
07:20:37
08:30:38
07:42:15

07:56:54

96:46:04


The requirement is that the end user should be able to sum these values and get a total figure in the final xls or xlsx file. The total should be the last value.

My question is how should I do all this formatting. This is what I tried

worksheet.Cells[row, col].Value = "100:12:30";              

worksheet.Cells[row, col].Style.Numberformat.Format = "[h]:mm:ss";

but when I open the spreadsheet, though I see the format [h]:mm:ss I cannot add the cells. Please help