Usage Of SimpleDateFormat / DateFormat

(Doc ID 340956.1)

Last updated on SEPTEMBER 01, 2014

Applies to:

JDBC - Version and later
Information in this document applies to any platform.


Obtaining values for a date column from Oracle Database returns these dates always in the following format:
The code being used looks like:
  boolean tf = stmt.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MM-YYYY'");
  ResultSet rs = stmt.executeQuery("SELECT SYSDATE FROM DUAL");
  while( {
    System.out.println("Got: " + rs.getDate(1) );


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms