title: C# Read actual cell value from Excel where Date format is Long date and Calendar type is Western
body: <p>In Excel, cell format has been set to LongDate format (Note Calendar Type is western. This calendar type is not available with C# class)
  <a href="https://i.stack.imgur.com/5rv1O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5rv1O.png" alt="enter image description here"></a></p>
  
  <p>Value Displayed in Excel cell - 15 December 2019</p>
  
  <p>Code to Read and Assert cell value</p>
  
  <pre><code>cellValue = ExcelInteropHelper.ReadExcelCellValue(9, 1);
  Assert.AreEqual("15 December 2019 00:00:00", cellValue);
  </code></pre>
  
  <p>But when trying to read value from excel the value is: 15-12-2019 00:00:00</p>
  
  <p>Tried Code :</p>
  
  <pre><code>    var cellValue = (object)(xlWorksheet.Cells[rowNumber, columnNumber] as Excel.Range).Value;
      // output : 15-12-2019 00:00:00
  </code></pre>
  
  <p>The difference in both values (expected: "15 December 2019 00:00:00" and actual: "15-12-2019 00:00:00") is due to Calendar Types Western and Gregorian.
  C# provides support only for Gregorian Calendar.</p>
  
  <p>I don't want to change calendar type in Excel as it provides range of Datetime formats. I just need to read actual value from Excel i.e. "15 December 2019 00:00:00"</p>