How can I get datetime to display in wartime in oracle?

I am running some queries to track the problem with our backup logs and would like to display datetime fields in 24 hour wartime. Is there an easy way to do this? I tried searching on the Internet and could not find anything.

+4
source share
4 answers
select to_char(sysdate,'DD/MM/YYYY HH24:MI:SS') from dual; 

Give time in 24 hour format.

Additional options are described here .

+14
source

If you want all requests in your session to display full datetime, do

 alter session set NLS_DATE_FORMAT='DD/MM/YYYY HH24:MI:SS' 

at the beginning of the session.

+2
source

Use to_char(field,'YYYYMMDD HH24MISS') .

A good list of date formats is available here.

+1
source

This is not the oracle that defines the display of dates; it is a tool that you use to run queries. What do you use to show results? Then we can hope for the correct settings.

0
source

Source: https://habr.com/ru/post/1276936/


All Articles