Class DateTimeConverter
A converter for handling System.DateTime values in line with how classical serialization handles them.
Inheritance
System.Object
DecoratedSpecification<System.Reflection.TypeInfo>
ConverterBase<System.DateTime>
DateTimeConverter
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ExtendedXmlSerializer.ContentModel.Conversion
Assembly: ExtendedXmlSerializer.dll
Syntax
public sealed class DateTimeConverter : ConverterBase<DateTime>, IConverter<DateTime>, ISpecification<TypeInfo>, IConvert<DateTime>
Constructors
DateTimeConverter(XmlDateTimeSerializationMode)
Creates a new instance with the provided mode.
Declaration
public DateTimeConverter(XmlDateTimeSerializationMode mode)
Parameters
System.Xml.XmlDateTimeSerializationMode
mode
The mode used to handle conversion for provided DateTime instances. |
Properties
Default
The default instance of this converter.
Declaration
public static DateTimeConverter Default { get; }
Property Value
DateTimeConverter
|
Local
A local variant of this converter. This is called with System.Xml.XmlDateTimeSerializationMode.Local.
Declaration
public static DateTimeConverter Local { get; }
Property Value
DateTimeConverter
|
Methods
Format(DateTime)
Used to format the provided instance into its text representation.
Declaration
public override string Format(DateTime instance)
Parameters
System.DateTime
instance
|
Returns
System.String
The string representation of the provided instance. |
Overrides
ExtendedXmlSerializer.ContentModel.Conversion.ConverterBase<System.DateTime>.Format(System.DateTime)
Parse(String)
Used to parse the provided text into a new instance of the converter type.
Declaration
public override DateTime Parse(string data)
Parameters
System.String
data
The text from which to create a new instance. |
Returns
System.DateTime
An instance created from the provided text. |
Overrides
ExtendedXmlSerializer.ContentModel.Conversion.ConverterBase<System.DateTime>.Parse(System.String)