Export (0) Print
Expand All

DateTimeFormatInfo.TimeSeparator Property

Gets or sets the string that separates the components of time; that is, the hour, minutes, and seconds.

[Visual Basic]
Public Property TimeSeparator As String
[C#]
public string TimeSeparator {get; set;}
[C++]
public: __property String* get_TimeSeparator();
public: __property void set_TimeSeparator(String*);
[JScript]
public function get TimeSeparator() : String;
public function set TimeSeparator(String);

Property Value

The string that separates the components of time; that is, the hour, minutes, and seconds. The default for InvariantInfo is ":".

Exceptions

Exception Type Condition
ArgumentNullException The property is being set to a null reference (Nothing in Visual Basic).
InvalidOperationException The property is being set and the DateTimeFormatInfo is read-only.

Remarks

If the custom pattern includes the format pattern ":", DateTime.ToString displays the value of TimeSeparator in place of the ":" in the format pattern.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

DateTimeFormatInfo Class | DateTimeFormatInfo Members | System.Globalization Namespace | DateSeparator

Show:
© 2015 Microsoft