TimeZone.TryParse MethodTimeZone.TryParse MethodTimeZone::TryParse Method

Converts a lexical representation to its TimeZoneTimeZoneTimeZone equivalent. A return value indicates whether the conversion succeeded or failed.

Syntax

Public Shared Function TryParse( _
    value As String, _
    <Out>result As ByRef TimeZone _
) As Boolean
public static bool TryParse(
    string value,
    out TimeZone result
)
public:
static bool TryParse(
    String^ value, 
    [Out] TimeZone% result
)
 

Parameters

value

Type: System.StringSystem.StringSystem::String^

The lexical value to convert.

result

Type: out XmlPrime.TimeZoneByRef XmlPrime.TimeZoneXmlPrime::TimeZone%

When this method returns, contains the TimeZoneTimeZoneTimeZone value represented by value if the conversion succeeded, or UTC (Z) if the conversion failed.

Return Value

Type: System.BooleanSystem.BooleanSystem::Boolean

trueTruetrue if the conversion succeeded; otherwise falseFalsefalse.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionvalue is null a null reference (Nothing in Visual Basic) nullptr.

Remarks

The lexical representation is as parsing a time zone from an xs:dateTime. It is in the format (('+' | '-') hh ':' mm) | 'Z'