I try to guess the answer:
- The
cellValue
contains a comma as a decimal separator. so it's
value is e.g. 0,5833333333
.
- You replace the comma with a point =>
0.5833333
-
- Converting this to a double on a french server reveals
58333333333
.
- Adding this to a date produces the exception.
Your software does not expect a point '.'
as the decimal separator, but whatever is configured on the target system. As long as the excel source remains on the same computer, you don't have to exchange anything.
Also, is it really and XLS-format or are you talking about CSV? If your data comes from a french EXCEL exported as CSV, you will end up in having decimal values formatted using a comma. Now you check your software on your local PC (which has US culture I guess) and you are adding the code to replace the comma with a point. Wow, it now works on your PC! But don't expect that same code to work on another machine.
You either have to parse the decimal value manually or just rely that the data source (your EXCEL data) is formatted on a machine having the same culture settings as your the machine running your application.
One guess why values less than 12:00
work: Maybe by accident. If you check 06:00
it will be 0,25
as decimal and converted to 25
which is perfectly alright (well, it does not throw an exception).
Please don't forget: It is only a guess as we haven't seen all relevant information.