TimeWithZone.ToString Method (string, CultureInfo)TimeWithZone.ToString Method (String, CultureInfo)TimeWithZone::ToString Method (String^, CultureInfo^)

Converts the value of the current TimeWithZoneTimeWithZoneTimeWithZone object to its equivalent string representation using the specified format and culture-specific format information.

Syntax

Public Function ToString( _
    format As String, _
    cultureInfo As System.Globalization.CultureInfo _
) As String
public string ToString(
    string format,
    System.Globalization.CultureInfo cultureInfo
)
public:
String^ ToString(
    String^ format, 
    System.Globalization::CultureInfo^ cultureInfo
)
 

Parameters

format

Type: System.StringSystem.StringSystem::String^

A stringStringString describing the format.

cultureInfo

Type: System.Globalization.CultureInfoSystem.Globalization.CultureInfoSystem.Globalization::CultureInfo^

A CultureInfoCultureInfoCultureInfo object that supplies culture-specific formatting information.

Exceptions

ExceptionCondition
ArgumentExceptionArgumentExceptionArgumentExceptionThe syntax of the picture string in format is invalid.
ArgumentNullExceptionArgumentNullExceptionArgumentNullException format or cultureInfo is null a null reference (Nothing in Visual Basic) nullptr
InvalidOperationExceptionInvalidOperationExceptionInvalidOperationExceptionA component specified within format is not available (e.g. time components).

Remarks

The format must be a valid argument to the XSLT 2.0 format-time function.