My Oracle Support Banner

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) );


To view full details, 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 a vibrant support community of peers and Oracle experts.