The Advanced SQL Engine has 5 Date and Time data types:
SQL Data Type | Description |
Date | The Date data type has Year, Month and Day components. The range of values are from January 1, 01 through December 31, 9999. |
Time(fractional_second_digits) | The Time data type has Hour, Minute, Second and Fractional-Second components. The number of digits for the Fractional-Second component ranges from 0 to 6. The SQL Engine defaults the fractional seconds to 6 digits. The range of values are from 00:00:00.000000 through 23:59:59.999999. |
Time(fractional_second_digits) With Time Zone | The Time With Time Zone data type has Hour, Minute, Second, Fractional-Second, Time Zone Hour and Time Zone Minute components. The number of digits for the Fractional-Second component ranges from 0 to 6. The SQL Engine defaults the fractional seconds to 6 digits. The Time Zone range of values are from -12:59 through +14:00. |
Timestamp(fractional_second_digits) | The Timestamp data type has Year, Month, Day, Hour, Minute, Second and Fractional-Second components. The number of digits for the Fractional-Second component ranges from 0 to 6. The SQL Engine defaults the fractional seconds to 6 digits. The range of values are from January 1, 01 00:00:00.000000 through December 31, 9999 23:59:59.999999. |
Timestamp(fractional_second_digits) With Time Zone | The Timestamp data type has Year, Month, Day, Hour, Minute, Second, Fractional-Second, Time Zone Hour and Time Zone Minute components. The number of digits for the Fractional-Second component ranges from 0 to 6. The SQL Engine defaults the fractional seconds to 6 digits. The range of values are from January 1, 01 00:00:00.000000 through December 31, 9999 23:59:59.999999. The Time Zone range of values are from -12:59 through +14:00. |
The "SQL Data Type and Literals" manual describes each type in detail. This sections shows how the SQL Engine Date and Time data types map to the .NET type system.
The Base Class Library (BCL) has three Date and Time data types:
Notable differences between the SQL Engine data Types and BCL types are:
The .NET Data Provider for Teradata has five Date and Time Provider Specific Types and it also converts the SQL Engine Date And Time data types to BCL types.
SQL Data Type | BCL Type | Provider Specific Type |
---|---|---|
Date | DateTime | TdDate |
Time | TimeSpan | TdTime |
Time With Time Zone | String | TdTimeWithTimeZone |
Timestamp | DateTime | TdTimestamp |
Timestamp With Time Zone | DateTimeOffset | TdTimestampWithTimeZone |
The Date and Time Provider Specific Types can perform the following operations:
The Provider Specific Types and BCL Types can be used as parameters in all database operations, and data can be retrieved using these types by invoking the corresponding TdDataReader methods.
The calendar for TdDate, TdTimestamp, and TdTimestampWithTimeZone is based on the Gregorian calendar.
The Date And Time types do not adjust for Daylight Savings.
Components of Date And Time Types
Timestamp With Time Zone Data Type
Culture Specific Formatting and Parsing of Strings
Connection String Attributes Related to Date And Time Types