<span style=“color: rgb(36, 39, 41); font-family: Arial, “Helvetica Neue”, Helvetica, sans-serif; font-size: 15px; background-color: rgb(255, 255, 255);”>I am currently using aspose.cells for .Net and need to set a custom format a date based on the current language being used in our app. Issue is, we are setting the format via code below, but if the system(OS) date format is different, our custom formatting goes for a toss and the excel displays the date in the system(OS) format. Is there a workaround for this? Below is the code:
<span style=“color: rgb(36, 39, 41); font-family: Arial, “Helvetica Neue”, Helvetica, sans-serif; font-size: 15px; background-color: rgb(255, 255, 255);”>
<span style=“color: rgb(36, 39, 41); font-family: Arial, “Helvetica Neue”, Helvetica, sans-serif; font-size: 15px; background-color: rgb(255, 255, 255);”>
<pre style=“margin-top: 0px; margin-bottom: 1em; padding: 5px; border: 0px; font-size: 13px; width: auto; max-height: 600px; overflow: auto; font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; background-color: rgb(239, 240, 241); word-wrap: normal; color: rgb(36, 39, 41);”><code style=“margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; white-space: inherit;”>var dateStyle = dataWorksheet.Cells.GetCellStyle(startRowNumber, column);
dateStyle.Custom = CultureInfo.CreateSpecificCulture("en-US").DateTimeFormat.ShortDatePattern;
var dateRange = dataWorksheet.Cells.CreateRange(startRowNumber, column, dataTable.Rows.Count + 1, 1);
dateRange.SetStyle(dateStyle);</code></pre></div>