Send feedback on this topic.
Teradata.Client.Provider
ToString(String) Method



Teradata.Client.Provider Namespace > TdDate Structure > ToString Method : ToString(String) Method
The DateTime format string that will be used to format the TdDate.
TdDate is converted to the equivalent String using the specified format.
Syntax
'Declaration
 
Public Overloads Function ToString( _
   ByVal format As String _
) As String
'Usage
 
Dim instance As TdDate
Dim format As String
Dim value As String
 
value = instance.ToString(format)
public string ToString( 
   string format
)
public:
String^ ToString( 
   String^ format
) 

Parameters

format
The DateTime format string that will be used to format the TdDate.

Return Value

A string representation of the date in TdDate.
Exceptions
ExceptionDescription
The format is invalid.
Remarks

If the format parameter is null, the string representation of TdDate will be equivalent to the "G" format specifier which is "yyyy-MM-dd".

If the this instance is TdDate.Null, a string that contains "Null" will be returned.

The format specifiers that are supported are as follows:

Format Specifier Description
d Short date pattern.
D Long date pattern.
G The ANSI string representation. For TdDate the format will be an ANSI Date "yyyy-MM-dd". Cultural information is ignored.
M or m Month day pattern
L or l The Teradata literal representation of a Date.
Y or y Year month pattern

For more information on format specifiers refer to the Globalization.DateTimeFormatInfo in the MSDN documentation.

Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdDate Structure
TdDate Members
Overload List