When querying an oracle date, I see only the date - not the time. Example
select D from ALIK_TZ
Result:
D
01-JUN-16
How can I see the time as well?
When querying an oracle date, I see only the date - not the time. Example
select D from ALIK_TZ
Result:
D
01-JUN-16
How can I see the time as well?
Use TO_CHAR with time format. Example below.
Consider the date being saved in column named D
, than the following query would get the time as well:
select to_char(D, 'DD-MON-YYYY HH24:MI:SS') D_TIME, D from ALIK_TZ;
Result:
D_TIME D
01-JUN-2016 06:14:04 01-JUN-16
Since you have answered it yourself. Just to add the reason as why you are getting the result in the format DD-MON-YY format. Oracle docs says:
For input and output of dates, the standard Oracle date format is DD-MON-YY
Also note that Oracle uses the TO_CHAR
function internally whenever a DATE value is displayed, Oracle will call TO_CHAR
automatically using the default DATE format which is DD-MON-YY.
Hence you need to change it using the TO_CHAR
function to get the date in the format which you want.