The following table shows the result of the CAST function or Teradata conversion based on the options specified. The time zone adjustment may change the YEAR, MONTH, and DAY fields of the DATE value.
| Option | timestamp_expression Data type | Result |
|---|---|---|
| AT LOCAL | With or without TIME ZONE | Result is date portion of source timestamp_expression after adjusting UTC value by adding time zone displacement based on current session time zone. This is the same as not specifying AT clause. |
| AT SOURCE (where SOURCE is keyword and not column reference) |
WITH TIME ZONE | Result is date portion of source timestamp_expression after adjusting UTC value by adding time zone displacement associated with timestamp_expression. |
| Without TIME ZONE | Error is returned. | |
| AT SOURCE TIME ZONE | WITH TIME ZONE | Result is date portion of source timestamp_expression after adjusting UTC value by adding time zone displacement associated with timestamp_expression. |
| Without TIME ZONE | Error is returned. | |
| AT [ TIME ZONE ] expression | With or without TIME ZONE | Result is date portion of source timestamp_expression after adjusting UTC value by adding time zone displacement defined by expression. |
| AT [ TIME ZONE ] time_zone_string | With or without TIME ZONE | Result is date portion of source timestamp_expression after adjusting UTC value by adding time zone displacement based on time_zone_string. Time zone displacement is based on time_zone_string and TIMESTAMP value of timestamp_expression. |