SoapYear.Parse(String) Method

Definition

Converts the specified String into a SoapYear object.

public:
 static System::Runtime::Remoting::Metadata::W3cXsd2001::SoapYear ^ Parse(System::String ^ value);
public static System.Runtime.Remoting.Metadata.W3cXsd2001.SoapYear Parse (string value);
static member Parse : string -> System.Runtime.Remoting.Metadata.W3cXsd2001.SoapYear
Public Shared Function Parse (value As String) As SoapYear

Parameters

value
String

The String to convert.

Returns

A SoapYear object that is obtained from value.

Exceptions

value does not contain a date and time that corresponds to any of the recognized format patterns.

Examples

The following code example shows how to use this method. This code example is part of a larger example that is provided for the SoapYear class.

// Parse an XSD date to create a SoapYear object.
String^ xsdDate = "2003";
SoapYear^ date = SoapYear::Parse( xsdDate );
// Parse an XSD gYear to create a SoapYear object.
// The time zone of this object is -08:00.
string xsdYear = "2003-08:00";
SoapYear year = SoapYear.Parse(xsdYear);

Remarks

The Parse method is capable of parsing strings in various formats. The recognizable string formats are composed out of the following format patterns.

Format Pattern Description Examples
yyyy The year in 4-digit format. 1999, 1812
zzz The full time zone offset (hour and minutes) from the Universal Time Coordinate (Greenwich Mean Time). Single-digit hours have a leading zero. -07:00, 08:00

Applies to