skip to main content
Welcome to the Progress DataDirect for JDBC for Oracle Driver : Data types : Using date/time data types : Date/time session parameters : TIMESTAMP WITH TIME ZONE data type
  

Try DataDirect Drivers Now
TIMESTAMP WITH TIME ZONE data type
By default, the Oracle TIMESTAMP WITH TIME ZONE data type is mapped to the JDBC VARCHAR data type.
When retrieving TIMESTAMP WITH TIME ZONE values as a string (using resultSet.getString(), for example), the value is returned as the string representation of the timestamp including time zone information. The string representation is formatted as:
'YYYY-MM-DDHH24:MI:SS.FFTZH:TZM'
where:
*YYYY is the 4-digit year.
*MM is the month.
*DD is the day.
*HH24 is the hour in 24-hour format.
*MI is the minutes.
*SS is the seconds.
*FF is the fractional seconds.
*TZH is the time zone hours and TZM is the time zone minutes. The time zone is represented as the difference in hours and minutes between the time zone and GMT.
By default, retrieving TIMESTAMP WITH TIME ZONE values as a timestamp (using ResultSet.getTimeStamp, for example) is not supported because the time zone information stored in the database would be lost when the data is converted to a timestamp. To provide backward compatibility with existing applications, you can use the FetchTSWTZasTimestamp property to allow TIMESTAMP WITH TIME ZONE values to be returned as a timestamp. The default value of the FetchTSWTZasTimestamp property is false, which disables retrieving TIMESTAMP WITH TIME ZONE values as timestamps.
When setting TIMESTAMP WITH TIME ZONE columns:
*Using a timestamp (using PreparedStatement.setTimestamp(), for example), the value set is converted to the time zone specified by the TIME_ZONE session parameter.
*Using a string (using PreparedStatement.setString(), for example), the string is passed as-is to the server. The supplied string must be in the format specified by the NLS_TIMESTAMP_TZ_FORMAT session parameter. If not, the Oracle server generates an error when it attempts to convert the string to the TIMESTAMP WITH TIME ZONE type.