Time Zone Abbreviations Internationalized in Java?

I'm trying to fgure out if anyone knows if Java provides time zone abbreviations (specifically) internationalized. We have a third party library that we are using to retrieve the abbreviated time zone display for the current locale (France). We get the correct time zone returned, "CEST" (Central European Summer Time), but as I understand it "CEST" is the english translation of that time zone and the French version is "HAEC" which stands for "heure d'été d'Europe centrale".
After debugging through that library it appears its just getting the Time Zone display from Java's rt.jar. After looking inside there at the TimeZoneNames_fr.java this is what I am seeing (keep in mind some of this is speculation)
String[] arrayOfString15 = { "Heure d'Europe centrale", "CET", "Heure d'été d'Europe centrale", "CEST" };
To me this looks like Java can return the internationalized version of the full time zone name, but we are going to get the english translation of the abbreviation.
Would anyone be able to confirm this for me?
Here is a test I mocked up:
TimeZone tz = TimeZone.getTimeZone("Europe/Paris");
System.out.println("Time Zone (Long English): " + tz.getDisplayName(true, 1));
System.out.println("Time Zone (Short English): " + tz.getDisplayName(true, 0)); // Actual Code in third party library
System.out.println("Time Zone (Long French): " + tz.getDisplayName(true, 1, Locale.FRANCE));
System.out.println("Time Zone (Short French): " + tz.getDisplayName(true, 0, Locale.FRANCE));
and the results:
Time Zone (Long English): Central European Summer Time
Time Zone (Short English): CEST
Time Zone (Long French): Heure d'été d'Europe centrale
Time Zone (Short French): CEST
I ran also ran the same code snippet using the ICU4J 4.6.1 locale SPI provider and here's the output.
Time Zone (Long English): Central European Summer Time
Time Zone (Short English): CEST
Time Zone (Long French): heure avancée d’Europe centrale
Time Zone (Short French): HAEC

Double post: http://forum.java.sun.com/post!reply.jspa?messageID=3826011

Similar Messages

  • Get time zone abbreviations

    How to get current time zone abbreviations from oracle?
    Why “select EXTRACT(timezone_abbr FROM current_timestamp) TA
    FROM dual;” Qury returns a ‘UNK’?

    To have a valid timezone abbreviation you need to set a time_zone :
    SQL> select current_timestamp from dual;
    CURRENT_TIMESTAMP
    12/03/07 14:28:10,566726 +01:00
    SQL> select EXTRACT(timezone_abbr FROM current_timestamp) TA
      2  FROM dual;
    TA
    UNK
    SQL> alter session set time_zone = 'cet';
    Session altered.
    SQL> select current_timestamp from dual;
    CURRENT_TIMESTAMP
    12/03/07 14:28:23,702305 CET
    SQL> select EXTRACT(timezone_abbr FROM current_timestamp) TA
      2  FROM dual;
    TA
    CET
    SQL> Nicolas.

  • TimeStamp with time zone vs java Date

    In the developer's preview release notes, I read about the extended support on Oracle TimeStamp. We are currently planning to migrate current TIMESTAMP columns to TIMESTAMP WITH TIMEZONE to keep the user time zone with the typed date. Here is my question: Which time zone is persisted using a direct to field mapping between a java.util.Date and a TIMESTAMPTZ column? As the java.util.Date contains no time zone (in opposition to java.util.Calendar), does TopLink uses the JVM time zone? WHat is the best to data structure to keep date/time & time zone in our entities? Thanks, Yannick.

    I believe it would be the local timezone of the session. If you map a Date to the TIMESTAMP TZ then the SQL written out will not include a TZ value.
    Typically if you wish to map to a TIMESTAMPTZ field you would want to use an object in the model that can hold both the Timestamp and TZ values. This is most commonly a Calendar.
    Doug

  • Time Zone issues EDT to PDT conversion. Really need help!

    Have a question regarding conversion from EDT to PDT time zones and on different Java versions...
    If you compile the program below and run it using JRE 1.6, 1.5 versus 1.4, 1.3 it gives different results. Maybe somebody has an answer:
    Here is the code:
    import java.text.*;
    import java.util.*;
    public class Moh {
            public static void main(String[] args) throws Exception {
                    SimpleDateFormat timestampFormatWithZone = new SimpleDateFormat("yyyy-MM-dd HH:mm z");
                    Date date = timestampFormatWithZone.parse("2007-06-06 14:00 EDT");
                    System.out.println(date.toString());
    }Copile it and run using these two options. The one with
    New York shall show you 2pm or 14:00 and when using the
    second one output changes:
    java -Duser.timezone=America/New_York Moh
    java -Duser.timezone=America/Los_Angeles Moh
    If you use JRE 1.6 or 1.5 second option will give you 12:00; if you
    use JRE 1.4 or JRE 1.3 it will show 11am or 11:00
    I think that 11am is correct! Is there any issues with newer JREs and timezone conversion. Or am I missing anything?
    Thank you so much for your help!

    Yes, there are issues. See the following from Sun Microsystems
    Sun(sm) Alert Notification
        * Sun Alert ID: 102836
        * Synopsis: Olson TZ Data (tzdata2005r or
    greater) Incompatibility Issues
        * Category: Availability
        * Product: Java 2 Platform, Standard Edition
        * BugIDs: 6466476, 6530336
        * Avoidance: Upgrade
        * State: Resolved
        * Date Released: 08-Mar-2007
        * Date Closed: 08-Mar-2007
        * Date Modified:
    1. Impact
    The introduction of Olson Timezone (TZ) data,
    version 2005r or greater, may break backward
    compatibility for the Eastern, Hawaiian, and
    Mountain time zones, under certain circumstances.
    This issue is also outlined in Sun BugIDs 6466476
    and 6530336, listed at:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6466476
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6530336
    Note: The Hawaiian TZ is only affected for
    historical data. Other American TZs such as PST and
    CST are not affected.
    2. Contributing Factors
    This issue can occur in the following releases for
    all platforms:
        * JDK and JRE v1.4.2_12 and above
        * JDK and JRE 5.0u8 and above
        * JDK and JRE 6 and above
    Notes:
       1. Releases below Java SE v1.4.x are not affected
    by this issue.
       2. The condition will also exist if you have run
    the "Time Zone Updater Tool" for v1.4.x+, but
    without the -bc flag.
    This condition will be apparent under one of the
    following two circumstances:
    A) The use of old 3-letter TZ IDs, limited to:
    "EST", "HST", "MST".
    Or:
    B) The parsing of date strings containing one of the
    following three TZ strings: "EDT", "HDT", or "MDT".
    3. Symptoms
    The symptoms/result of this condition will be that
    Daylight Saving Time (DST) will be calculated
    incorrectly.
    4. Relief/Workaround
    There is no workaround for this issue. Please see
    the Resolution section below.
    5. Resolution
    To resolve this issue (ie. to enable support for the
    backward compatible DST timezones), run the "Time
    Zone Updater Tool" for v1.4.x+ with the command line
    options:
        -f -bc
    Complete instructions for running the tool can be
    found at:
    http://java.sun.com/javase/tzupdater_README.html
    Note: If you have already run without the -bc flag,
    you will need to rerun with the -f -bc flag to
    correctly resolve the 3-letter TZ abbreviation issue.
    The -bc options will result in the deletion of the
    files:
        * JAVAHOME/jre/lib/zi/EST
        * JAVAHOME/jre/lib/zi/MST
        * JAVAHOME/jre/lib/zi/HST
    There are no known side effects to removing these files.
    Install Issues :
    In the unlikely event of unforeseen issues (e.g:
    such as power loss or I/O Error) restore the JRE
    Time Zone files to their original state by:
    A) following the instructions at
    http://java.sun.com/javase/tzupdater_README.html#remove
    Or:
    B) removing and then reinstalling the JRE or JDK.
    The update may now be re-applied by running the TZ
    Updater Tool (with the proper command line options)
    as listed above.
    For additional information on issues, products, and
    resources for DST changes, please also see:
    http://www.sun.com/dst
    This Sun Alert notification is being provided to you
    on an "AS IS" basis. This Sun Alert notification may
    contain information provided by third parties. The
    issues described in this Sun Alert notification may
    or may not impact your system(s). Sun makes no
    representations, warranties, or guarantees as to the
    information contained herein. ANY AND ALL
    WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT
    LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS
    FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE
    HEREBY DISCLAIMED. BY ACCESSING THIS DOCUMENT YOU
    ACKNOWLEDGE THAT SUN SHALL IN NO EVENT BE LIABLE FOR
    ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, OR
    CONSEQUENTIAL DAMAGES THAT ARISE OUT OF YOUR USE OR
    FAILURE TO USE THE INFORMATION CONTAINED HEREIN.
    This Sun Alert notification contains Sun proprietary
    and confidential information. It is being provided
    to you pursuant to the provisions of your agreement
    to purchase services from Sun, or, if you do not
    have such an agreement, the Sun.com Terms of Use.
    This Sun Alert notification may only be used for the
    purposes contemplated by these agreements.
    Copyright 2000-2006 Sun Microsystems, Inc., 4150
    Network Circle, Santa Clara, CA 95054 U.S.A. All
    rights reserved.

  • How are updates to JDK time zone provided?

    How are updates to the time zone information in the Java TimeZone classes provided? Is the information based on the "Olson" "tzdata" public domain data? Are the updates only provided through JDK releases?

    The decree is Number 5.920 - October 3rd 2006
    http://www.in.gov.br/materias/xml/do/secao1/2345913.xml
    Edi��o N�mero 191 de 04/10/2006
    Atos do Poder Executivo
    DECRETO N o 5.920, DE 3 DE OUTUBRO DE 2006
    Institui a hora de ver�o, em parte do territ�rio nacional, no per�odo que indica.
    O PRESIDENTE DA REP�BLICA , no uso da atribui��o que lhe confere o art. 84, inciso IV, da Constitui��o, e tendo em vista o disposto no art. 1 o , inciso I, al�nea "b", do Decreto-Lei n o 4.295, de 13 de maio de 1942,
    DECRETA:
    Art. 1 o A partir de zero hora do dia 5 de novembro de 2006, at� zero hora do dia 25 de fevereiro de 2007, vigorar� a hora de ver�o, em parte do territ�rio nacional, adiantada em sessenta minutos em rela��o � hora legal.
    Art. 2 o A hora de ver�o a que se refere o art. 1 o ser� institu�da nos Estados do Rio Grande do Sul, Santa Catarina, Paran�, S�o Paulo, Rio de Janeiro, Esp�rito Santo, Minas Gerais, Goi�s, Mato Grosso, Mato Grosso do Sul e no Distrito Federal.
    Art. 3 o Este Decreto entra em vigor na data de sua publica��o.
    Bras�lia, 3 de outubro de 2006; 185 o da Independ�ncia e 118 o da Rep�blica.
    LUIZ IN�CIO LULA DA SILVA
    Silas Rondeau Cavalcante Silva

  • Java time zone parameter has no affect.

    I am attempting to set the timezone on a single stack Java instance to match the time zone settings on our ERP EHP6 system. I set the parameter
    -Dusertimezone=CST and GMT-5 using the configuration manager, save the change and restart the JAVA stack.  Each time I restart the system I get the attached error in the default trace log and when I check system info page the timezone still shows as GMT. What is the proper abbreviation to use for US Central Time Zone.
    OS is Windows 2008 R2 with the timezone correctly set. The DB is Oracle 11.2.0.4 and SAP is netweaver 7.0 EHP1.
    Thank You in Advance
    Troy Sorbet
    The error is listed in the attached file, sorry I can't get text to paste into the note.
    This is the banner for the error message
    "The specified time zone is not found in SchedulerTime config class"

    See SAP KBA 1867012 for a list of valid values. That said the error is returned from the KM Scheduler service, meaning it isn't global. I assume your instance starts but only the KM Scheduler service doesn't start. If that's the case what is the SP level of your NW701 system? Applying SAP note 1675803 might solve your problem.

  • Change the time zone in Java System only

    Hi there,
    Does anyone knows where to change the time zone in Java system only? I know in ABAP they have t-code: STZAC? where do I change in Java? Configtool or visual admin? what is the service name or parameter for this?
    Thanks
    Kumar

    hi Kumar,
    You can change the timezone of the JVMs using the -Duser.timezone
    parameter,  add -Duser.timezone=<timezone> to all dispatcher and
    server processes in your systems, using the configtool           
    1) open config tool                                              
    2) select yes                                                    
    3) select "cluster-data->instanceXXX->serverXXX/Dispatcher"      
    4) in "Java parameters" add new line "-Duser.timezone=<timezone>"
    5) click "Apply changes"                                         
    6) restart your instance
    Let me know how is the result
    Regards

  • Does anyone know how I can update the Java 1.3.1 Time Zone Definitions?

    I have an Application that was packaged with Java Runtime 1.3.1 before the DST Changes and need to update the time zone definitions to correct for the difference in the old DST dates and the new DST dates for Central Time Zone - US.

    I don't get it. Why were DST incorporated into the 'Application'? Normally a Java app. would get them from the JRE (AFAIU), and if the '1.3.1 built' app. is run using Java 1.5 or 1.6, it will pick up the updated DST.

  • Look-up java time zone based on location?

    I have a test app where I can assign a java timezone and return time info - However, I don't see a way to look-up a java time zone based on location (combination of city/province/state/country).
    Is this possible?

    Has any one found a way to lookup a timezone based on a city/region in the world? So one could be able to type any city and state/province and country combination and get the corresponding timezone for that region. Is there a place where one can buy this data?
    Thank you

  • Reg Custom Time Zone in java

    Hi ,
    Have configured the custom Time Zone (SAST) in the Linux box.
    The sh clock of the Linux box gives the custom Time Zone (SAST).
    Whereas the java application gives the date in GMT Time Zone.
    Noticed from the java docs that, if the custom time zone string (SAST) doesn't match the syntax ( like GMT +Value or GMT-Value) , "GMT" is used.
    Even if we create SimpleTimeZone with offset from GMT, it displays the date in “GMT” format. It won’t display the custom Time Zone.
    Could anybody please suggest me a way to support Custom Time Zone in java?
    (i.e.) The java application should give the date in custom Time Zone (SAST) instead of GMT format.
    FYI : Java version : "1.5.0_17"
    ================== Snippet from java docs====================================
    The format is locale independent and digits must be taken from the Basic Latin block of the Unicode standard. No daylight saving time transition schedule can be specified with a custom time zone ID. If the specified string doesn't match the syntax, "GMT" is used.
    Java doc URL : http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimeZone.html

    hi Kumar,
    You can change the timezone of the JVMs using the -Duser.timezone
    parameter,  add -Duser.timezone=<timezone> to all dispatcher and
    server processes in your systems, using the configtool           
    1) open config tool                                              
    2) select yes                                                    
    3) select "cluster-data->instanceXXX->serverXXX/Dispatcher"      
    4) in "Java parameters" add new line "-Duser.timezone=<timezone>"
    5) click "Apply changes"                                         
    6) restart your instance
    Let me know how is the result
    Regards

  • I need help with java Time Zone Updater for Venezuela Time Zone

    Hi,
    I've run the latest Time Zone Updater (1.3.5) on JRE 1.4.2. It is supposed to support the time zone changes for Venezuela. The problem is that when I set my Windows time zone and run java.util.TimeZone.getDefault() it says that I am on GMT instead of GMT-04:30.
    Am I doing something wrong?
    Thanks in advance for your help.

    I have found the solution for cases in which you cannot update your JRE to anything further than 1.5. You will have to create an extra entry in the Java tzmappings file as follows:
    Venezuela Standard Time:90,90::America/Caracas:After doing this, you will have to create a new String Value in your Windows registry for the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Venezuela Standard Time Key as follows:
    Name: MapID
    Value: 90,90
    Best regards.

  • Java.util.Date time zone

    Hi
    We have a very interesting problem. We are running a Java app server (ATG Dynamo) and it has decided to start working in PST even though the Unix server is configured to EST (i.e. if you run �System.our.println(new java.util.Date())� you get the time in PST. If you type date into the shell prompt you get EST). Incidentally this only happens on production. On all the other machines everything shows up as EST.
    So my question is: How does Java decide what time zone it is in?
    I always figured it would take that information from the System. Right?
    Thank
    Zeev Neumeier

    It depends on your JVM and version.
    Sun JVM versions before 1.1.8 had a bug which caused it to always use the zone in the JVM which was PST.
    The Sun JVM uses system information to determine it. What exactly it does requires code spelunking. You can try getGMTOffsetID(),Java_java_util_TimeZone_getSystemGMTOffsetID() in C files and TimeZone.getDefault() in java. It is certainly possible that an ENV var is doing it.
    If all else fails then you can explicitly set it on the commad line...
    java -Duser.timezone=EST MyClass

  • Get date from Oracle when local time zone is different from Oracle time zon

    Hi!
    Local machine time zone= +2
    Oracle time zone= +1
    I set date to Oracle using java.sql.Date.
    From application I save date at 00:30 clock and send e.g. 28.06.2002, but in Oracle date is save as 27.06.2002 01:00 (hour=01 , I suppose that is because java.sql.Date hasn't time the Oracle set it time = time zone=+1) And when I get date from Oracle I get incorrect date. In SQL I don't use date masks. Maybe solution is to use java.sql.Timestamp object (when save date to Oracle) instead of java.sql.Date?
    But if I save date at e.g. 01:00 clock and send e.g. 28:06.2002 in Oracle, date is save as 28.06.2002 01:00 and when I read from Oracle I get correct date.
    Thank you.

    Hi!
    Local machine time zone= +2
    Oracle time zone= +1
    I set date to Oracle using java.sql.Date.
    From application I save date at 00:30 clock and send
    e.g. 28.06.2002, but in Oracle date is save as
    27.06.2002 01:00 (hour=01 , I suppose that is because
    java.sql.Date hasn't time the Oracle set it time =
    time zone=+1) Presumably you are using setTimestamp() to store the value. If you are explicitly using a varchar (string) then you will have to correct the timezone your self.
    And when I get date from Oracle I get
    incorrect date. In SQL I don't use date masks. Maybe
    solution is to use java.sql.Timestamp object (when
    save date to Oracle) instead of java.sql.Date?The method setDate/getDate store a 'date' which is not the same as a 'date and time' for which setTimestamp/getTimestamp are used.
    But if I save date at e.g. 01:00 clock and send e.g.
    28:06.2002 in Oracle, date is save as 28.06.2002
    01:00 and when I read from Oracle I get correct date.
    Thank you.

  • How can I correct time zone information

    Yesterday  Europe/Moscow zone was changet from  GMT+4 to GMT+3
    I've managed to adjust ical4j.jar library replacing Moscow.ics by this very simple zone file
    BEGIN:VCALENDAR
    PRODID:-//Oracle//Calendar Server//EN
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:Europe/Moscow
    X-LIC-LOCATION:Europe/Moscow
    BEGIN:STANDARD
    TZOFFSETFROM:+0300
    TZOFFSETTO:+0300
    TZNAME:MSK
    DTSTART:19700101T000000
    END:STANDARD
    END:VTIMEZONE
    END:VCALENDAR
    After init-config for both davserver and Convergence this jar file is deployed and I see It into
    /opt/glassfish3/glassfish/domains/domain1/applications/davserver/WEB-INF/lib/
    directory.
    Moreover I found modified zoneinfo file into
    opt/glassfish3/glassfish/domains/domain1/generated/jsp/davserver/loader_27469283/zoneinfo/Europe/Moscow.ics
    I see in the Convegence Options Time Zone Europe Moscow GMT+0300
    So far so good.
    Bad news when I export calendar via Convergence calendar interface  I see in  the head of ICS file the following time zone information
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//Oracle Corporation/CS 7.0.4.15.0//EN
    BEGIN:VTIMEZONE
    TZID:Europe/Moscow
    X-LIC-LOCATION:Europe/Moscow
    BEGIN:STANDARD
    TZOFFSETFROM:+0400
    TZOFFSETTO:+0400
    TZNAME:MSK
    DTSTART:19700101T000000
    END:STANDARD
    END:VTIMEZONE
    BEGIN:VEVENT
    The offset +0400 is absolutely wrong!
    Since I see in convergence all events shifted by one hour back respect to lightning data.
    I found a lot of information about how to add time zone alias, but have no info about correction existing time zone.
    Any comments are welcome.
    Thank you, Monk.
    P.S.
    Operating system time zone information is right.
    Java time zone is updated too.

    Yes I know about time zone information into VEVENT Object.
    Can You provide me URL where I can download plugin you are talking about?
    Plugin can be for Firefox or Chrome.
    Till now I can only use export calendar button of Convergence Calendar interface.
    Here you can find two event
    th-17 and th-19 created by Lightning
    th-17 - started 17-00
    th-19 - started 19-00
    According to the Convergence them start at 16-00 and 18-00 respectively.
    By the way .Lightning show them correct but fire alarm one hour earlier.
    15-45
    17-45
    Seams that Lightning took wrong time zone information from the server with +4 offset.
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//Oracle Corporation/CS 7.0.4.15.0//EN
    BEGIN:VTIMEZONE
    TZID:Europe/Moscow
    X-LIC-LOCATION:Europe/Moscow
    BEGIN:STANDARD
    TZOFFSETFROM:+0400
    TZOFFSETTO:+0400
    TZNAME:MSK
    DTSTART:19700101T000000
    END:STANDARD
    END:VTIMEZONE
    BEGIN:VEVENT
    UID:e22635db-e82a-4422-be31-b2f0adb00c21
    DTSTAMP:20141027T125056Z
    SUMMARY:th-17
    DTSTART;TZID=Europe/Moscow:20141027T170000
    DTEND;TZID=Europe/Moscow:20141027T180000
    CREATED:20141027T122644Z
    LAST-MODIFIED:20141027T125056Z
    TRANSP:OPAQUE
    X-MOZ-GENERATION:2
    X-MOZ-LASTACK:20141027T124511Z
    BEGIN:VALARM
    DESCRIPTION:Default Mozilla Description
    ACTION:DISPLAY
    TRIGGER;VALUE=DURATION:-PT15M
    END:VALARM
    END:VEVENT
    BEGIN:VEVENT
    UID:d0c3b01f-970b-4d5a-97cc-999f8a3e8e90
    DTSTAMP:20141027T144856Z
    SUMMARY:th-19
    DTSTART;TZID=Europe/Moscow:20141027T190000
    DTEND;TZID=Europe/Moscow:20141027T200000
    CREATED:20141027T124446Z
    LAST-MODIFIED:20141027T144856Z
    TRANSP:OPAQUE
    X-MOZ-GENERATION:1
    X-MOZ-LASTACK:20141027T144856Z
    X-MOZ-SNOOZE-TIME:20141027T145356Z
    BEGIN:VALARM
    DESCRIPTION:Default Mozilla Description
    ACTION:DISPLAY
    TRIGGER;VALUE=DURATION:-PT15M
    END:VALARM
    END:VEVENT
    X-NSCP-WCAP-ERRNO:0
    END:VCALENDAR

  • Problem in Date time Zone parsing

    Hi Guys,
    I want format of String of time whic have time zone also. But how can i validate weather my date is correct or not .
    This is i am doing because of Auto grow up problem in SimpleDateFormat.
    For example : If i am parsing "2.00 AM GMT" as per mask "h:mm a z" should be correct if after format output is "2.00 AM GMT"
    but if i am trying "15.00 AM GMT" as per mask it should be invalidated because after format it will return "3.00 PM GMT" this is also working as per my expectaion
    But When i changed the Timzoe mask from GMT to PDT it get again fails
    suggesiotn for resolving this isse willl be appreciated
    // TODO Auto-generated method stub
    import java.util.Date;
    import java.util.TimeZone;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.SimpleTimeZone;
    public class checkDates {
         public static String getTimeZoneId(String getTimeZone) {
              // Modifies the default time zone, disables the Daylight Saving Time.
              TimeZone dtz = (TimeZone) TimeZone.getDefault();          
              int l_rawOffset = dtz.getRawOffset();
              String l_id =TimeZone.getTimeZone(getTimeZone).getID();          
              SimpleTimeZone l_simpleTimeZone = new SimpleTimeZone(l_rawOffset, l_id, 0, 0, 0, 0, 0, 0, 0, 0);
              TimeZone.setDefault(l_simpleTimeZone);
              return TimeZone.getTimeZone(getTimeZone).getID();
         public static void main(String[] args) {
              // String aMask = "MM/dd/yyyy";
              String aMask = "hh:mm a z";
              String newEffDate = "15:00 AM GMT+03:00";
              String timeZoneId ="";
              SimpleDateFormat mydf = new SimpleDateFormat(aMask);
              if(aMask.indexOf("z")>0){
                   if(newEffDate.length()>aMask.indexOf("z")){
                        timeZoneId = getTimeZoneId(newEffDate.substring(aMask.indexOf("z")));
                        System.out.println(newEffDate + " Time Zone id = ["+timeZoneId+ "]");
                        mydf.setTimeZone(TimeZone.getTimeZone(timeZoneId));
              Date date = null;
    /*          System.out.println(System.getProperty("user.timezone"));
              System.out.println(TimeZone.getDefault().toString());     
              System.out.println(mydf.getTimeZone().toString());     */          
              try {
                   date = mydf.parse(newEffDate);
                   System.out.println("\n\n\nDate is working -\nInput " + newEffDate);
                   System.out.println("Date is working -\nOUTPUT " + mydf.format(date));
                   if (!mydf.format(date).equals(newEffDate)) {
                        throw new ParseException("[" + newEffDate + "] Unparseable date: \"newEffDate\" " + "[" + mydf.format(date) + "] [" + aMask + "]", aMask.indexOf("z"));
              } catch (ParseException pe) {
                   pe.printStackTrace();
                   System.out.println(pe.getMessage() + "---" + pe.getErrorOffset());
    }

    There's a setLenient method you can use.

Maybe you are looking for