Send feedback on this topic.
Teradata.Client.Provider
Date And Time Data Types Overview
.NET Data Provider for Teradata > Developer's Guide > Data Types > Date And Time Data Types Overview

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:

  1. System.DateTime
  2. System.TimeSpan
  3. System.DateTimeOffset

Notable differences between the SQL Engine data Types and BCL types are:

  1. BCL supports 7 fractional second digits while the SQL Engine supports 6 fractional second digits.
  2. BCL does not have Date data type. BCL has a DataTime data type.
  3. BCL does not have a Time data type. BCL has TimeSpan data type representing a duration of time or elapsed time.
  4. BCL does not have a Time With Time Zone data type.

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.

Calendar

The calendar for TdDate, TdTimestamp, and TdTimestampWithTimeZone is based on the Gregorian calendar.

Daylight Savings

The Date And Time types do not adjust for Daylight Savings.

In This Section

Components of Date And Time Types

Time Zone

Date Data Type

Time Data Type

Time With Time Zone Data Type

Timestamp Data Type

Timestamp With Time Zone Data Type

Culture Specific Formatting and Parsing of Strings

Arithmetic Operations

Connection String Attributes Related to Date And Time Types