Wednesday, June 15, 2022

TIMESTAMP WITH TIME ZONE Data Type

1.    TIMESTAMP WITH TIME ZONE is a variant of TIMESTAMP that includes a time zone region name
 or a time zone offset in its value. 
2.    The time zone offset is the difference (in hours and minutes) between local time and UTC 
(Coordinated Universal Time—formerly Greenwich Mean Time). 
This data type is useful for preserving local time zone information.
 
Specify the TIMESTAMP WITH TIME ZONE data type as follows:
 
TIMESTAMP [(fractional_seconds_precision)] WITH TIME ZONE
 
where fractional_seconds_precision optionally specifies the number of digits Oracle stores in the
 fractional part of the SECOND datetime field. 
When you create a column of this data type, the value can be a number in the range 0 to 9. 
The default is 6.
 

The following format specifies a TIMESTAMP WITH TIME ZONE literal:

TIMESTAMP 'YYYY-MM-DD HH24:MI:SS.FF TZH:TZM'

Ex:

TIMESTAMP '2017-08-10 10:30:20.15 -07:00'
 

Besides the time zone offset, you can use time zone region name as follows:

TIMESTAMP 'YYYY-MM-DD HH24:MI:SS.FF TZR'
 

Ex:

TIMESTAMP '2017-08-10 10:30:20.15 US/Pacific'

No comments:

Post a Comment