System.Globalization.DateTimeFormatInfo.LongTimePattern Property

Gets or sets the custom format string for a long time value.

Syntax

public string LongTimePattern { get; set; }

Value

A string containing the format pattern for a long time value.

Exceptions

TypeReason
ArgumentNullExceptionThe value specified for a set operation is a null reference.
InvalidOperationExceptionThe current instance is read-only and a set operation was attempted.

Remarks

The DateTimeFormatInfo.LongTimePattern property defines the culture-specific format of date strings that are returned by calls to the DateTime.ToString and DateTimeOffset.ToString methods and by composite format strings that are supplied the "T" standard format string.

We recommend that you set the time separator in the long time pattern to an exact string instead of using the time separator placeholder. For example, to obtain the pattern h-mm-ss, set the long date pattern to "h-mm-ss".

Requirements

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0