Permalink
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (57 sloc) 2.84 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
<dateTimeSerialization> Element
03/30/2017
.net
article
VB
CSharp
C++
jsharp
dateTimeSerialization element
XML serialization, configuration
<dateTimeSerialization> element
90fda55c-7730-41e9-bc4b-6423a4b920af
5
Erikre
erikre
erikre

<dateTimeSerialization> Element

Determines the serialization mode of xref:System.DateTime objects.

<configuration>
<dateTimeSerialization>

Syntax

<dateTimeSerialization  
    mode = "Roundtrip" | "Local"  
/>  

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attributes Description
mode Optional. Specifies the serialization mode. Set to one of the xref:System.Xml.Serialization.Configuration.DateTimeSerializationSection.DateTimeSerializationMode values. The default is RoundTrip.

Child Elements

None.

Parent Elements

Element Description
system.xml.serialization The top-level element for controlling XML serialization.

Remarks

In versions 1.0, 1.1, 2.0 and later versions of the .NET Framework, when this property is set to Local, xref:System.DateTime objects are always formatted as the local time. That is, local time zone information is always included with the serialized data. Set this property to Local to ensure compatibility with older versions of the .NET Framework.

In version 2.0 and later versions of the .NET Framework that have this property set to Roundtrip, xref:System.DateTime objects are examined to determine whether they are in the local, UTC, or an unspecified time zone. The xref:System.DateTime objects are then serialized in such a way that this information is preserved. This is the default behavior and is the recommended behavior for all new applications that do not communicate with older versions of the framework.

See Also

xref:System.DateTime
xref:System.Xml.Serialization.XmlSchemaImporter
xref:System.Xml.Serialization.Configuration.DateTimeSerializationSection.DateTimeSerializationMode
Configuration File Schema
<schemaImporterExtensions> Element
<add> Element for <xmlSchemaImporterExtensions>
<system.xml.serialization> Element