When I load an xls file, which is created by the user, to SpreadSheetGear workbook it changes date format from dd/mm/yyyy to mm/dd/yyyy. How can I prevent this?
I use the code below (VB.NET) to load xls file:
WorkbookView1.ActiveWorkbook =
SpreadsheetGear.Factory.GetWorkbookSet.Workbooks.OpenFromMemory(xlsFile)
xlsFile is a Byte array.
You should be able to open the workbook using a culture info that defaults to
dd/mm/yyyy
. This may be your current culture.This site gives a good overview of .Net Framework culture defaults. http://www.basicdatepicker.com/samples/cultureinfo.aspx
I had the problem when importing excel xlsx to my site it was shifting the date from dd/MM/yyyy to MM/dd/yyyy though the system data was set to dd/MM/yyyy, the below method gave me the correct format I want.