DateFormat Z has wrong offset ?

Been adding TimeZone i18n to an application and have found that the GMT offset for some of the timezones found within the JVM doesnt match their names. This is best explained with an example
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import java.util.TimeZone;
public class TimeZoneTest {
    public static void main(String[] args) throws Exception {
        SimpleDateFormat formatter = new SimpleDateFormat("Z", Locale.getDefault());
        TimeZone tz = TimeZone.getTimeZone("Etc/GMT+8");
        formatter.setTimeZone(tz);
        String offset = formatter.format(Calendar.getInstance().getTime());
        System.out.println("TimeZone ID: " + tz.getID());
        System.out.println("TimeZone GMT Offset(Z): " + offset);
}when i run this code i get the following result:
TimeZone ID: Etc/GMT+8
TimeZone GMT Offset(Z): -0800
Based on the timezone id i would expect the offset(Z) to be +0800.
Can someone please explain this to me.
Thanks
Sam

That is because "Etc/GMT+8" came from the UNIX world which handles GMT offsets the other way around. If you need GMT+8, you could use "GMT+8" which is called a `custom' time zone ID. It's normalized to "GMT+08:00" in getTimeZone().
Masayoshi

Similar Messages

  • Repost CO Doc with wrong offsetting account...

    Hi Experts,
    Please kindly advise,
    We have settlement doc like below :
    CR : Expense 1
    CR : Expense 2
    DR : Expense 3
    DR : AuC
    And we found in our CO report (KOB1), we have settlement doc like below
    1. Expense 1 with offsetting AuC
    2. Expense 2 with offsetting act AuC
    3. Expense 3 with offsetting act Expense 1
    Is there any way to repost this wrong settlement doc since this doc is belonging to period 10 of 2010.
    We have tried to look any SAP notes, but there is anything relevant to our system, since we use ECC 6.0
    Thank you for your kind reply.

    Hi Ajay,
    Thanks.
    It seems this note will only influence for future posting. How about the doc that has already posted.
    Would you mind how to implement this exit ?
    Please advise. Thank you.
    Btw... would you like suggest, what actually happened to our system since we found some CO doc, only has header, but its line items are deleted form the COEP table.
    Thanks
    Hi Filipe,
    Actually we have tried to delete and repost with this note.. But this issue still exist since we found 3 line items have wrong offsetting account in CO line item report (KOB1).
    Please kindly advise.Anyway thanks for you immediate response.

  • HTMLDB_APPLICATION.G_F01 has wrong value!

    HTMLDB_APPLICATION.G_F01 has wrong value!
    Hello again,
    I have a search page in my app (here the user defines the search criteria) P1.
    The page branches to P130, where the result is shown. This second page contains a region of type 'SQL Query (PL/SQL Function Body Returning SQL Query)'. The code for this dynamic query is 231 lines of code, so I want to spare you scrolling through it here . What it basically does is generating SQL QRY's such as the following:
    select     distinct(sq.SAMPLE_ID) XXX,
    'ID: '||sq.SAMPLE_ID||'
    ' ||'Type: '||sq.SAMPLE_TYPE||'
    ' ||'Collection Date: '||sq.COLLECTION_DATE SAMPLE_INFO,
    'Aliquots (T/A): '||to_char(sq.ALIQUOTS_TOTAL)|| '/' ||to_char(sq.ALIQUOTS_AVAILABLE)||'
    ' ||'Volume (T/A): '||to_char(sq.VOLUME_TOTAL,'990D00')|| '/' ||to_char(sq.VOLUME_AVAILABLE,'990D00') AVAILABILITY,
    'Age: '||sq.PATIENT_AGE||'
    ' ||'Gender: '||sq.PATIENT_SEX||'
    ' ||'Bloodtype: '||sq.BLOOD_TYPE||'
    ' PATIENT_INFO,
    DML_SERVICE.get_Diagnoses(sq.SAMPLE_ID) DIAGNOSES,
    DML_SERVICE.get_Medications(sq.SAMPLE_ID) MEDICATIONS,
    DML_SERVICE.get_Interferences(sq.SAMPLE_ID) INTERFERENCES,
    DML_SERVICE.get_LabData(sq.SAMPLE_ID) LABDATA,
    decode(to_char(sq.ALIQUOTS_AVAILABLE), '0', null, htmldb_item.text(1, '1', 1, 2)) ORDER_QTY,
    decode(to_char(sq.ALIQUOTS_AVAILABLE), '0', null, htmldb_item.checkbox(2,sq.SAMPLE_ID)) ORDER_ME
    from SEARCH_V01 sq
    where sq.DIAGNOSIS = 'D-Dimer'
    order by 1 desc
    The DML_SERVICE functions just return a string(Varchar2). At the right side of the report I have two columns, one with a textfield (ORDER_QTY, default: 1) and one with a checkbox (ORDER_ME) for each line.
    For each line where the checkbox is checked, a process (On Submit - after Comp and Val) places the order for the requested quantity (this is done by inserting an Order ID into the ALIQUOTS table -> see bold update statement below).
    The process follows:
    declare
    alq_qty number;
    alq_id number;
    cnt number;
    begin
    cnt := 0;
    for i in 1..HTMLDB_APPLICATION.G_F02.count
    loop
    select count(*) -- set alq_qty to number of available alq's
    into alq_qty
    from ALIQUOTS a
    where a.SAMPLE_ID = HTMLDB_APPLICATION.G_F02(i)
    and a.ORDER_ID = 0;
    insert into D_DEBUG (ID, DD) values (1, 'wanted: ' || HTMLDB_APPLICATION.G_F01(i) || ' available: ' || alq_qty); -- REMOVE!!!
    if alq_qty > to_number(HTMLDB_APPLICATION.G_F01(i)) then -- if there are enough alq's
    alq_qty := to_number(HTMLDB_APPLICATION.G_F01(i)); -- set alq_qty to number of ordered alq's
    end if;
    for n in 1..alq_qty
    loop
    select min(ID)
    into alq_id
    from ALIQUOTS
    where sample_id = HTMLDB_APPLICATION.G_F02(i)
    and order_id = 0;
    insert into D_DEBUG (ID, DD) values (1, 'alq_id: '||alq_id); -- REMOVE!!!
    update ALIQUOTS
    set order_id = :P130_SELECT_ORDER
    where id = alq_id;
    cnt := cnt + 1;
    end loop;
    dml_service.upd_sample_record(HTMLDB_APPLICATION.G_F02(i)); -- refresh data in SAMPLE table
    end loop;
    :P130_MSG := 'Assigned '||cnt||' aliquots to order: '||:P130_SELECT_ORDER;
    end;
    Now my problem is that this process does what it should, sometimes. When I enter 6 in one row and check the checkbox and enter 4 in another row and check that checkbox and then press SUBMIT, 10 aliquots are assigned to my order.
    Sometimes.... the other times the process just orders 2 aliquots, one of each line and disregards the number entered in the textfield.
    Or so it may seem: I added some lines to write debug info into D_DEBUG (see above.) From those entries you can assume that the content of HTMLDB_APPLICATION.G_F01(i) is in fact '1' when the process does its work. So I think the problem lies somewhere in the creation of htmldb_item.text(), (I went through the API of that htmldb_item again and again...)
    Also: I can reproduce / recreate this error. It's totally weird: for some rows it (always) works and for some it (always) doesn't !!!
    So, any help, any suggestion is really appreciated (I'm currently working on bringing the crucial part of this to marvel.oracle.com)
    -David-
    [Edited by: sleuniss on Jul 15, 2004 12:18 PM]
    Changed subject line.

    Now the subjectline is right, but the indentation is gone.... :-(
    again the SQL query:
    select     distinct(sq.SAMPLE_ID) XXX,
               'ID: '||sq.SAMPLE_ID||'
    ' ||'Type: '||sq.SAMPLE_TYPE||'
    ' ||'Collection Date: '||sq.COLLECTION_DATE SAMPLE_INFO,
               'Aliquots (T/A): '||to_char(sq.ALIQUOTS_TOTAL)|| '/' ||to_char(sq.ALIQUOTS_AVAILABLE)||'
    ' ||'Volume (T/A): '||to_char(sq.VOLUME_TOTAL,'990D00')|| '/' ||to_char(sq.VOLUME_AVAILABLE,'990D00') AVAILABILITY,
               'Age: '||sq.PATIENT_AGE||'
    ' ||'Gender: '||sq.PATIENT_SEX||'
    ' ||'Bloodtype: '||sq.BLOOD_TYPE||'
    ' PATIENT_INFO,
               DML_SERVICE.get_Diagnoses(sq.SAMPLE_ID) DIAGNOSES,
               DML_SERVICE.get_Medications(sq.SAMPLE_ID) MEDICATIONS,
               DML_SERVICE.get_Interferences(sq.SAMPLE_ID) INTERFERENCES,
               DML_SERVICE.get_LabData(sq.SAMPLE_ID) LABDATA,
               decode(to_char(sq.ALIQUOTS_AVAILABLE), '0', null, htmldb_item.text(1, '1', 1, 2)) ORDER_QTY,
               decode(to_char(sq.ALIQUOTS_AVAILABLE), '0', null, htmldb_item.checkbox(2,sq.SAMPLE_ID)) ORDER_ME
    from     SEARCH_V01 sq
    where  sq.DIAGNOSIS = 'D-Dimer'
    order    by 1 desc
    and the process:
    declare
       alq_qty number;
       alq_id number;
       cnt number;
    begin
       cnt := 0;
       for i in 1..HTMLDB_APPLICATION.G_F02.count
       loop
          select count(*) -- set alq_qty to number of available alq's
           into alq_qty
           from ALIQUOTS a
           where a.SAMPLE_ID = HTMLDB_APPLICATION.G_F02(i)
           and a.ORDER_ID = 0;
    insert into D_DEBUG (ID, DD) values (1, 'wanted: ' || HTMLDB_APPLICATION.G_F01(i) || ' available: ' || alq_qty); -- REMOVE!!!
          if alq_qty > to_number(HTMLDB_APPLICATION.G_F01(i)) then -- if there are enough alq's
             alq_qty := to_number(HTMLDB_APPLICATION.G_F01(i)); -- set alq_qty to number of ordered alq's
          end if;
          for n in 1..alq_qty
          loop
             select min(ID)
              into alq_id
              from ALIQUOTS
              where sample_id = HTMLDB_APPLICATION.G_F02(i)
              and order_id = 0;
    insert into D_DEBUG (ID, DD) values (1, 'alq_id: '||alq_id); -- REMOVE!!!
             update ALIQUOTS
              set order_id = :P130_SELECT_ORDER
              where id = alq_id;
             cnt := cnt + 1;
          end loop;
          dml_service.upd_sample_record(HTMLDB_APPLICATION.G_F02(i)); -- refresh data in SAMPLE table
       end loop;
       :P130_MSG := 'Assigned '||cnt||' aliquots to order: '||:P130_SELECT_ORDER;
    end;
    -David-

  • Initialization error : class file has wrong version 49.0, should be 45.3 or

    I have Jdeveloper Base installation and JDK 1.5..the classpath and JAVA_HOME environment variables are set to the respective JDK1.5\bin folders. Even then when i try to make a web application, with a simple JSP page i get the following error :
    Initialization error: class file has wrong version 49.0, should be 45.3 or 46.0 or 47.0 or 48.0 on CLASSPATH ..(followed by a long list of paths)
    pls help,
    thanks

    i have windows XP. i have tried to unset the class path...i get the same error.
    i have JDeveloper 10g 10.1.2.
    i have changed the jdev.conf file to set the Java Home to the path that contains the JDK 1.5..

  • SAPINST: "Database EPD has wrong compability level"

    Hi
    We are doing a "homogeneous system copy" of a java system:
    WebAS Java 6.40 SP16 (with EP 6.0 SP16)
    Basically we are changing from a 32-bit platform to a 64-bit platform and ind the process also shifting from MSSQL 2000 to 2005 and renaming the SID.
    Source platform:
    - MSSQL 2000
    - Windows 2003 on x86
    Target platform:
    - MSSQL 2005
    - Windows 2003 on x64 (AMD)
    We are using SAPINST NW04 (patch collection version) and choosing to use a database-specific method for the database copy (backup/restore).
    On the target system the RDBMS MSSQL2005 (9.00.2047.00) has been installed and the source database (EPP) has been restores (and renamed as EPD).
    The error:
    When running the SAPINST on the target-platform in one of the last phases when prompted for the "Database Information" (choosing "EPD"), then we get the error "Database EPD has wrong compability level"
    Any idea what is wrong ?
    Best regards
    Tom Bo

    Hello,
    U might have to consider the impact of migrating the MSSQL 2000 to MSSQL 2005 also the impact of using the 32-bit to 64-bit conversion..
    U first have to consider the pre-migration checks for O.S. and DB...
    dont forget to give reward point plz.

  • 'Idoc has wrong status'

    Hi SDN,
    Good morning to all of you. I came infrom of you with a small quaery related to IDOC. My query is sales order is going to be created via IDOCs (Which came from XI) through FM IDOC_INPUT_ORDERS. While creating the SO we are generating the mails to users if any errors will be encountered, but here every thing is working fine and some times it is generating mail with the message 'Idoc has wrong status' for successful also. Not for all only for few sucessfull SO's it is generating mail. Please suggest me any configuration i need to check or any thing else. Please suggest me....Appriciate your valuable suggestions......Waiting for your valuable reposnse.....
    Regards,
    Kumar

    Hi Santosh,
    Thanks for your immediate response. It is giving me status 53.
    Regards,
    Kumar

  • OS has wrong time zone, so db has wrong time zone after RAC db installed

    hi Guru, after the RAC db installed, and it is a alive production DB, then I realized that the os has wrong time zone which is MDT (mountain time), I want it as CDT, so I am planning to ask sys admin to change os to CDT, then I just need to bounce the db once os time zone changed? Is that right? that won't corrupted the db after os time zone change right? And this is 2 nodes RAC db, anything I need to be aware before os level timezone change?

    Hello;
    Fix the time on the OS and restart the database and you should be done. Simple as that. So to answer your question Right.
    Best Regards
    mseberg

  • Smartform form {T_HEADER} has wrong page format

    I have a header window that contains a table for column headings just above my main window.  Somehow in the process of inserting a column and adjusting the size, I caused the following error to continue each time I attempt to print preview the form:
    Form T_HEADER has wrong page format.
    I have reviewed the details of the table to verify the width and the total of the line type column widths match.  The header window that contains the table also has the same width.  I am confused as to why I continue to get this error, but it is keeping me from testing any other changes to the form.  I am stuck here.
    P.S. I searched this forum for "form has wrong page format" and found one similar post that did not answer my issue.
    Thanks in advance.
    -PA

    hi Phillip,
    the easiest thing is that you download your form and upload it here, so I got a chance to import it and have a look at exact the same dataset as you do. OF course, delete all the stuff you don't want to share and is unnecessary to fix this issue.
    You can try one thing before, delete the table and create a new one with the same formats. Sometimes the compiler interpret it wrong because... I don't know why, but I realized that just delete helped
    ~Florian

  • Run time error 4706 column has wrong type to be key

    Hi,
    I am getting error after installing Bex BI 7 version , I have installed .net fromework 2.0 and BI7 version when i m trying to open the bex analyser i am getting the following visual basic
    error .
    Run time error 4706
    column has wrong type to be key

    please help any help in this regard will be appreceated

  • I Cloud has wrong Apple ID

    The iCloud just has wrong Apple ID on my new iPad and I see no option to change it to the correct one.  The area for Apple ID is grayed out and I can not change it. How can I fix the issue? It says a verified email to the email address I have logged in but its the wrong email therefore I can not verify or put in a correct password to delete the account.

    From Apple. What happen was I reset my phone and the I cloud was deleted when I entered my apple id back in I accidentally entered the wrong ID and sent the email to verify it to add it. I cant change it now at all its greyed out because its waiting for me to go onto the email I entered which is wrong and verify the account

  • My little Daughter has wrongly purchased some apps from her iTunes store using her iPad. Now we want to cancel the purchase. Our credit card has not been charged till yet. The amount is showing overdue in her account. Plz suggest us how to cancel the purc

    My younger daughter has wrongly purchased some apps from iTunes Store. The credit card has not been charged yet. It is showing overdue amount in her account. Can anyone suggest, how can we cancel the purchases?
    Regards,
    Usman Khawaja

    FOR ASSISTANCE WITH ORDERS - iTUNES STORE CUSTOMER SERVICE
    For assistance with billing questions or other order inquiries, please refer to our online support page by clicking here: http://www.apple.com/support/itunes/store/. If you cannot find the answers you are seeking in our robust knowledge base, you can contact us by visiting the following URL http://www.apple.com/support/itunes/store/, clicking on the appropriate Customer Service topic, then using the contact button or email form at the bottom of the page. Responses to emails will be provided as soon as possible.
    Phone: 800-275-2273 How to reach a live person: Press 0 four times
    Hours of Operation: Mon-Fri: 9am-5pm ET
    Email: [email protected]
     Cheers, Tom

  • LabVIEW Career Center link (under the Annoucements) has wrong or invalid URL.

    Hi Sir/ Mdm,
    My apology if this is duplicate or wrong board to post...
    New! LabVIEW Career Center link (under the Annoucements) has wrong or invalid URL.
    FYI and action Cheers!
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com

    That would explain my post here.

  • Class file has wrong version 51.0,should be 49.0

    Dear All,
    I have 2 jdk in my computer, one is 1.7 and another is 1.5. I got a eclipse from my co-worker, checkout project from svn, complied it successful. However, there is error : class file has wrong version 51.0,should be 49.0 when I run it in eclipse( this is google gwt project).
    One of my colleague said I should modify one cache file under the eclipse direcotry, but he forgot the loaction of this file.
    Anyone knows?

    After modified this file : org.eclipse.jdt.launching.prefs under : <project folder>\.metadata\.plugins\org.eclipse.core.runtime\.settings,
    this problem has been fixed.
    The modification is :
    add
    <libraryLocations>\r\n<libraryLocation
    jreJar\="D\:/Java/jdk7/jre/lib/resources.jar"
    jreJavadoc\="http\://docs.oracle.com/javase/7/docs/api/"
    jreSrc\="D\:/Java/jdk7/src.zip" pkgRoot\=""/>\r\n
    to it.
    eclipse is :
    Eclipse Java EE IDE for Web Developers.
    Version: Luna Release (4.4.0)
    Build id: 20140612-0600
    my questions are :
    1. what is this file used for?
    2. when use this file?
    3. why I have to add these information to it by hand rather than generate these automatically when I set jdk in eclipse preference?
    4. why this error occur if this file doesn't has <libraryLocations> when running project(the project compile success before running)?

  • SqlDeveloper 4.1 still has wrong sync package&body suggestion

    SqlDeveloper 4.1 still has wrong sync package&body suggestion

    as in SqlDeveloper 4.1EA2 has wrong sync package&body suggestion

  • New desktop has wrong path for page links in nav bar

    I created a new desktop and have the following problem. The image links to portal
    pages in the horizontal nav bar in the top have wrong path.
    Example.
    In the original portal the home page link in the nav bar has a image associated
    with it in workshop.
    \framework\skin\classic\images\home.gif
    The partial url generated for the image looks liek this:
    \mywebapp\\framework\skin\classic\images\home.gif.
    I created a new desktop everything works fine except for the images. The href's
    are created for the links but the image path is wrong.
    the url generated is : \mywebapp\appmanager\framework\skin\classic\images\home.gif
    The "appmanager" in the path causes the problem.
    Is this a bug?

    Hi Subbu,
    I used workshop page properties to associate the image to the page.
    framework/skins/classic/images/home.gif
    - Shankar
    Subbu Allamaraju <[email protected]> wrote:
    Shankar,
    Did you use any tag to create the img tag? Do you have any sample
    HTML/JSP snippet?
    Subbu
    Shankar Bala wrote:
    I created a new desktop and have the following problem. The imagelinks to portal
    pages in the horizontal nav bar in the top have wrong path.
    Example.
    In the original portal the home page link in the nav bar has a imageassociated
    with it in workshop.
    \framework\skin\classic\images\home.gif
    The partial url generated for the image looks liek this:
    \mywebapp\\framework\skin\classic\images\home.gif.
    I created a new desktop everything works fine except for the images.The href's
    are created for the links but the image path is wrong.
    the url generated is : \mywebapp\appmanager\framework\skin\classic\images\home.gif
    The "appmanager" in the path causes the problem.
    Is this a bug?

Maybe you are looking for

  • Transferring Hard Drives between G4's

    HI......I may have the chance to purchase a Quicksilver G4 (2002) from work. It is the 800MHz model with 1.25Gb RAM and a 160Gb hard drive..... It is running OS X 10.3.9.......... I am currently on OS X 10.4.8...... If I was to get it how do I transf

  • Problems with Photoshop CS6 reverting to trial

    i downloaded trial version of photoshop, trial ended, and i just purchased photoshop. it wont download. the trial version keeps showing up. i uninstalled and reinstalled multiply times.

  • MS-6337 and MS6368 Hang

    I am having difficulties with three of my computers.  Two have the MS-6368 motherboard and one has the MS-6337 (815EP Pro) motherboard.  In each instance, even though the motherboards are different, the problem is common.  The problem is, as soon as

  • Increase the partition size in red hat

    Hello, I want to increase Linux red hat (root) partition.how can i do this.I am very thankful to you Regards, Umair

  • Why cant i activate my iPhone on IOS 7?

    I downloaded IOS 7 using itunes on my computer. The first thing that happened was, iTunes shut down after the IOS 7 install, which made me lose all my contact info, i wasn't too mad about that, so i reset to factory settings. After that was finished,