SoapDate Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Wraps an XSD date type.

Namespace:   System.Runtime.Remoting.Metadata.W3cXsd2001
Assembly:  mscorlib (in mscorlib.dll)

System.Object
  System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDate

[SerializableAttribute]
[ComVisibleAttribute(true)]
public sealed class SoapDate : ISoapXsd

NameDescription
System_CAPS_pubmethodSoapDate()

Initializes a new instance of the SoapDate class.

System_CAPS_pubmethodSoapDate(DateTime)

Initializes a new instance of the SoapDate class with a specified DateTime object.

System_CAPS_pubmethodSoapDate(DateTime, Int32)

Initializes a new instance of the SoapDate class with a specified DateTime object and an integer that indicates whether Value is a positive or negative value.

NameDescription
System_CAPS_pubpropertySign

Gets or sets whether the date and time of the current instance is positive or negative.

System_CAPS_pubpropertyValue

Gets or sets the date and time of the current instance.

System_CAPS_pubpropertySystem_CAPS_staticXsdType

Gets the XML Schema definition language (XSD) of the current SOAP type.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodGetXsdType()

Returns the XML Schema definition language (XSD) of the current SOAP type.

System_CAPS_pubmethodSystem_CAPS_staticParse(String)

Converts the specified String into a SoapDate object.

System_CAPS_pubmethodToString()

Returns Value as a String.(Overrides Object.ToString().)

For more information about XSD data types, see "XML Data Types Reference" in the MSDN Library at http://msdn.microsoft.com/library.

The following code example demonstrates using the SoapDate class to wrap an XML date type.

using System;
using System.Runtime.Remoting.Metadata.W3cXsd2001;

public class Demo
{
    public static void Main(string[] args)
    {
        // Parse an XSD date to create a SoapDate object.
        string xsdDate = "2003-02-04";
        SoapDate date = SoapDate.Parse(xsdDate);

        // Serialize a DateTime object as an XSD date string.
        Console.WriteLine("The date in XSD format is {0}.",
            date.ToString());

        // Print the XSD type string of this particular SoapDate object.
        Console.WriteLine("The XSD type of the SoapDate object is {0}.",
            date.GetXsdType());

        // Print the value of the SoapDate object.
        Console.WriteLine("The value of the SoapDate object is {0}.",
            date.Value);

        // Print the sign of the SoapDate object.
        Console.WriteLine("The sign of the SoapDate object is {0}.",
            date.Sign);

        // Print the XSD type string of the SoapDate class.
        Console.WriteLine("The XSD type of SoapDate is {0}.",
            SoapDate.XsdType);
    }
}

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: