This project has moved and is read-only. For the latest updates, please go here.

Duration shows as string

Dec 2, 2014 at 5:21 PM
I'm using the following bit of code:
                    Case "Duration"
                        sheet.Cells(sheetRow, columnIndex + 1).Value = dc.ConvertedString 'ts.ToString
                        sheet.Cells(sheetRow, columnIndex + 1).Style.Numberformat.Format = "[h]:mm:ss"
to put values that are duration related into an XLSX sheet. The value appears, but is a text value, rather than a number value. I cannot open the sheet and perform calculations on the field, i.e. SUM does not work.

And ideas? or is this some obscure bug? The version of EPPlus in use is and this was exhibited in 3.x versions also.
Jun 7, 2016 at 10:34 PM
This is still an issue for me.

For some clarification, the object "dc" is a dll that determines the datatype that is passed to it, and returns the value in ConvertedString, along with the datatype in another property. It is being returned as a string as it was my assumption that by setting the format as I have, it would convert it to a time datatype. This works when I have an actual time, i.e. "3:07:56 pm" but not for a duration, i.e. "0:47:22.128".

Is there anything to resolve this?