Date date cell format in excel xml

I need to export a DataSet to an excel file. I have date columns in a DataSet. I need to make sure that the date format in the cells has the locale: English (UK) with the date format dd / mm / yyyy. I am currently setting the dd / mm / yyyy format with

<Style ss:ID="DateLiteral">
 <NumberFormat ss:Format="dd/mm/yyyy;@"/>
</Style> 

in the workbook item. How to set the desired language? It will also be nice if I know how to set the desired language using the current user machine culture using C # .net.

Thanks:)

+5
source share
1 answer

There is no need to format your own format, you can use one of the standard dates or default date formats

  • Total date
  • Long term date
  • Average date
  • Short date

/ , .

, 31 2009 " " 12/31/2009, 31/12/2009.

XML- :

<Style ss:ID="DateLiteral">
 <NumberFormat ss:Format="Short Date"/>
</Style>

<Row>
 <Cell ss:StyleID="DateLiteral">
  <Data ss:Type="DateTime">2009-12-31T00:00:00.000</Data>
 </Cell>
</Row>
+9

All Articles