Oracle stores timestamp as packets of bits, each one representing specific information. Any client program then can show the value in the format they prefer. In your case, if you want to show them as YYYY-MM-DD
alter session set nls_timestamp_format='YYYY-MM-DD';
If you do it in JPA, and you are using a pool, it would affect all the connections using such pool.
Example
SQL> create table t ( c1 timestamp ) ;
Table created.
SQL> insert into t values ( systimestamp ) ;
1 row created.
SQL> select * from t ;
C1
---------------------------------------------------------------------------
15-OCT-21 01.29.45.427944 PM
SQL> select dump(c1) from t ;
DUMP(C1)
--------------------------------------------------------------------------------
Typ=180 Len=11: 120,121,10,15,14,30,46,25,129,232,64
In my case, the value is shown using my default timestamp format
SQL> select parameter,value from v$nls_parameters where parameter='NLS_TIMESTAMP_FORMAT' ;
PARAMETER VALUE
---------------------------------------------------------------- ----------
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
Let's dig in what those values of the dump
function means. For our timestamp 15-OCT-21 01.29.45.427944 PM
we got the following dump
:
120,121,10,15,14,30,46,25,129,232,64
- Century: (
120
-100)*100 = 2000
- Year: (
121
-100) = 21 ( as century is 2000 + 21 = 2021 )
- Month: 10
- Day: 15
- Hour: 14 ( excess - 1 ) then 13
- Minute: 30 ( excess - 1 ) then 29
- Second: 46 ( excess - 1) then 45
The remaining part is the specific fraction of seconds stored in the timestamp value ( remember that timestamp in Oracle stores fraction of seconds up to nanoseconds ). As the dump is type 180, there is not time zone associated. Below you can find a link to an amazing answer from @Alex Poole explaining more in detail what I just told you here, plus the other types of timestamp with time zone.
Timestamp Bytes