tags:

views:

1896

answers:

4

I am running some queries to track down a problem with our backup logs and would like to display datetime fields in 24-hour military time. Is there a simple way to do this? I've tried googling and could find nothing.

A: 

It's not oracle that determines the display of the date, it's the tool you're using to run queries. What are you using to display results? Then we can point you to the correct settings hopefully.

Nick Craver
+8  A: 
select to_char(sysdate,'DD/MM/YYYY HH24:MI:SS') from dual;

Give the time in 24 hour format.

More options are described here.

Joe Skora
+1  A: 

Use a to_char(field,'YYYYMMDD HH24MISS').

A good list of date formats is available at http://www.ss64.com/orasyntax/fmt.html

Grant Johnson
+1  A: 

If you want all queries in your session to show the full datetime, then do

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

at the start of your session.

Matthew Watson