Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[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)
Syntax
'Declaration
Public Function ToString ( _
format As String _
) As String
public string ToString(
string format
)
public:
String^ ToString(
String^ format
)
member ToString :
format:string -> string
public function ToString(
format : String
) : String
Parameters
- format
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.
Remarks
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 null Nothing nullptr unit a null reference (Nothing in Visual Basic) or an empty string, the general format specifier, 'G', is used.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.