Ej, si la fecha es
2003-04-06T00:00:00
cuando se exporta a XML puede quedar así
2003-04-06T00:00:00-03:00
En este caso le agregó el GMT -3
Una solución posible es cambiar el DateTimeMode del dataset a Unspecified.
De esta forma, no se incluirá el offset (el -3) en el archivo XML.
System.Data.DataSet data = new DataSet();
// ...
// Iterate the columns and set DataColumn.DateTimeMode
// to DataSetDateTime.Unspecified to remove offset
// when serialized.
foreach (DataTable table in data.Tables)
{
foreach (DataColumn item in table.Columns)
{
// Switching from UnspecifiedLocal to Unspecified
// is allowed even after the DataSet has rows.
if (item.DataType == typeof(DateTime) &&
item.DateTimeMode == DataSetDateTime.UnspecifiedLocal)
{
item.DateTimeMode = DataSetDateTime.Unspecified;
}
}
}
No hay comentarios:
Publicar un comentario