ToString Method (String)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Converts the value of the current DateTime object to its equivalent string representation using the specified format.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

member ToString : 
        format:string -> string 


Type: System..::..String
A standard or custom date and time format string (see Remarks).

Return Value

Type: System..::..String
A string representation of value of the current DateTime object as specified by format.

The format parameter should contain either a single format specifier character (see Standard Date and Time Format Strings) or a custom format pattern (see Custom Date and Time Format Strings) that defines the format of the returned string. If format is nullNothingnullptrunita null reference (Nothing in Visual Basic) or an empty string, the general format specifier, 'G', is used.