Timzone Name Returning 'Custom' In Java Stored Procedure

(Doc ID 313307.1)

Last updated on JULY 05, 2017

Applies to:

Oracle Server - Enterprise Edition - Version: to - Release: 9.2 to 11.2
Information in this document applies to any platform.


When using a java stored procedure that attempts to get the timezone, the returned timezone is
'Custom' instead of the expected timezone such as 'America/New_York' or 'America/Los_Angeles'.

For instance, given the below Java Stored Procedure

--------------------------------- begin code ----------------------------------------

create or replace java source named "TEST_TZ"  as
import java.net.*;
import java.io.*;
import java.util.*;
import java.text.*;
public class TEST_TZ
    static public String java_get_tz()
        TimeZone tz = TimeZone.getDefault();
         return tz.getID();

create or replace FUNCTION get_TimeZone_Name return varchar2
    NAME 'TEST_TZ.java_get_tz() return java.lang.String';

----------------------------------- end code -----------------------------------------


When this is run, you receive the 'Custom' timezone

SQL> select get_timezone_name from dual;


And this happens even though your database timezone is correct as shown by the following:

SQL> select dbtimezone from dual;



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