There are three variants of the timestamp data type:
timestamp
timestamp with time zone
timestamp with local time zone
A timestamp differs from a date in that it is able to store fractions of a second. A date can only store integral values for seconds.
In addition to a timestamp, a timestamp with time zone also stores a timezone's
hour
minute
region
abbreviation
A timestamp with local time zone does not store the additional information that a timestamp with time zone stores - but it allows to use the TZH:TZM or TZR TZD format elements.
The current date/time is returned by the function systimestamp.
Substractions
Most resulting data types of a substraction where a timestamp is involved is an interval day to second.
A notable exception is the substraction of a number from a timestamp which results in a date.
drop table timestamp_diff purge;
create table timestamp_diff as
select
timestamp '2022-08-28 17:36:12.78' - 1234.56 as ts_nm, -- date
timestamp '2022-08-28 17:36:12.78' - date '1998-09-13' as ts_dt, -- interval day(9) to second(9)
timestamp '2022-08-28 17:36:12.78' - timestamp '1998-09-13 06:51:38.41' as ts_ts, -- interval day(9) to second(9)
timestamp '2022-08-28 17:36:12.78 +05:00' - timestamp '1998-09-13 06:51:38.41 +09:00' as ts_tz__ts_tz, -- interval day(9) to second(9)
date '2022-08-28' - timestamp '1998-09-13 06:51:38.41' as dt_ts -- interval day(9) to second(9)
from
dual
;
desc timestamp_diff;