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



Teradata.Client.Provider Namespace > TdPeriodDate Structure > ToString Method : ToString(String,IFormatProvider) Method
The DateTime format string that will be used to format the TdPeriodDate.
The culture specific information. The culture specific information is not used when converting a Period into a string.
TdPeriodDate is converted into the equivalent String representation using the specified format and culture information.
Syntax
'Declaration
 
Public Overloads Function ToString( _
   ByVal format As String, _
   ByVal formatProvider As IFormatProvider _
) As String
'Usage
 
Dim instance As TdPeriodDate
Dim format As String
Dim formatProvider As IFormatProvider
Dim value As String
 
value = instance.ToString(format, formatProvider)
public string ToString( 
   string format,
   IFormatProvider formatProvider
)
public:
String^ ToString( 
   String^ format,
   IFormatProvider^ formatProvider
) 

Parameters

format
The DateTime format string that will be used to format the TdPeriodDate.
formatProvider
The culture specific information. The culture specific information is not used when converting a Period into a string.

Return Value

A string representation of the period contained in TdPeriodDate.
Remarks

When a TdPeriodDate is converted to a string, both the beginning and ending bound will be included in the returning string. The format of the string will be:

    (Beginning Bound, Ending Bound)   

The period is surrounded by parentheses, and a comma is used as a separator between the Begin and End bounds.

The format specifier affects the string representation of the beginning and ending bounds of the period. Cultural information specified in the formatProvider is ignored.

The following format specifiers are supported by TdPeriodDate:

Format Specifier Description
G

The ANSI representation of the period: (yyyy-MM-dd, yyyy-MM-dd).

Example: (2008-08-14, 2008-12-15).

l or L

The SQL literal representation of the period: PERIOD'(yyyy-MM-dd, yyyy-MM-dd)'.

Example: PERIOD'(2008-04-14, 2008-12-15)'.

Requirements

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

See Also

Reference

TdPeriodDate Structure
TdPeriodDate Members
Overload List
ToString(String,IFormatProvider) Method