DateTimeSerializationSection.DateTimeSerializationMode Enum

Definition

Determines XML serialization format of DateTime objects.

This API supports the product infrastructure and is not intended to be used directly from your code.

public: enum class DateTimeSerializationSection::DateTimeSerializationMode
public enum DateTimeSerializationSection.DateTimeSerializationMode
type DateTimeSerializationSection.DateTimeSerializationMode = 
Public Enum DateTimeSerializationSection.DateTimeSerializationMode
Inheritance
DateTimeSerializationSection.DateTimeSerializationMode

Fields

Default 0

Same as Roundtrip.

Local 2

The serializer formats all DateTime objects as local time. This is for version 1.0 and 1.1 compatibility.

Roundtrip 1

The serializer examines individual DateTime instances to determine the serialization format: UTC, local, or unspecified.

Remarks

This enumeration is used by the serialization infrastructure only, and is not intended for public use. To actually set the serialization mode, create an application configuration file, and set the <dateTimeSerialization> Element to an appropriate setting. For more information about configuration files, see Configuration File Schema.

In versions 1.0 and 1.1 of .NET Framework, as well as in versions 2.0 and later when this property is set to Local, 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 versions 2.0 and later of the .NET Framework, with this property set to RoundtripDateTime objects are examined to determine whether they are in the local, UTC or an unspecified time zone, and are serialized in such a way that this information is preserved. This is the default behavior and is recommended for all new applications that do not communicate with older versions of the framework.

Applies to

See also