A bug in the SimpleDateFormat ?

When i parse the string "2089-03-28" with the SimpleDateFormat class, the result's timeZone change from CET to CEST...
There is a difference of 1 hour between the two timeZone. So i'm not able to (exactly) compute the difference (in day) between two date.
why? is it a bug ?
Here is the code :
s1 = "2089-03-27";
s2 = "2089-03-28";
sdf = new SimpleDateFormat("yyyy-MM-dd");
d1 = sdf.parse(s1);
d2 = sdf.parse(s2);
System.out.println(s1 + " -> " + d1.toString() + " -> " + d1.getTime());
System.out.println(s2 + " -> " + d2.toString() + " -> " + d2.getTime());
diff = (d2.getTime() - d1.getTime());
div = 24 * 60 * 60 * 1000; // # number of ms in a day
res = diff / div; // give me the number of day between the two date
System.out.println(diff + " / " + div + " = " + res);
System.out.println(diff + " - " + div + " = " + (diff-div));here is the result :
2089-03-27 -> Sun Mar 27 00:00:00 CET 2089 -> 3762716400000
2089-03-28 -> Mon Mar 28 00:00:00 CEST 2089 -> 3762799200000
8.28E7 / 8.64E7 = 0.9583333333333334
8.28E7 - 8.64E7 = -3600000.0i used a little workaround. So i did my job correctly but i wish to known what the SimpleDAteFormat do...
Thanks for any help.

i try with another date between 200-01-01 and
2089-03-27 and it always work!
It seems that SimpleDateFormat don't like the date
"2089-03-28". Why? I want to know... ;-)You were given the answer. What was confusing about the replies you received?

Similar Messages

  • Bug on the property "disabledDays" of the component af|inputDate ?

    Hi,
    I think there is a bug on the property "disabledDays" of the component af|inputDate :
    <af:inputDate disabledDays="#{MyInputDate.disabledDays}"
    public class MyInputDate {     
        public DateListProvider getDisabledDays() {
            return new DateListProvider() {
                public List<java.util.Date> getDateList(FacesContext pFacesContext, Calendar pCalendar, java.util.Date pDate, java.util.Date pDate1) {
                    List<java.util.Date> my_array = new ArrayList<java.util.Date>();
                    try {
                        my_array.add(new SimpleDateFormat("MM/dd/yyyy").parse("1/1/2012"));
                    } catch (Exception e) {
                    return my_array;
    Problem:      While Only the 1 January 2012 cannot be selected, December 1, 2011 cannot be selected too !
    It's the same for every first day of each month...
    So, if it's possible, how can i use this property without this bug ?
    I use Oracle JDeveloper 11g Release 1 (11.1.1.4.0).

    Hi,
    the issue indeed reproduces. The fix however is pretty simple
        public List<Date> getDateList(FacesContext facesContext, Calendar calendar, Date startDate, Date endDate) {
            ArrayList<Date> l = new ArrayList<Date>();
            Date d;
            try {
                d = new SimpleDateFormat("MM/dd/yyyy").parse("01/01/2012");
                if (endDate.compareTo(d)< 0){
                    //ignore setting
                else{
                    l.add(d);
            } catch (ParseException e) {
                    e.printStackTrace();
            return l;
        }Just check if the date you set is earlier than the min range of the actual date display. If it is, don't set it as it is of no use anyway
    Frank
    Ps.: Bug filed

  • I think there is a very annoying bug after the latest update of firefox, can I talk to someone, or chat with someone so I can get rid of it

    Since the latest auto update of my firefox browser I am experiencing strange issues. Every evening when I stop working, I close my browser (closing all the tabs that I am working on and in the morning, I restore the session) . For many years everything worked just fine ... untill after the last auto update of the firefox browser .. all of a sudden a got 302 errors ( a blank page with the description 302 and I believe "page moved here" or something to that extend ... i try to click the link and get nowhere.
    I first noticed it on a few wordpress pages (backend ) that I was working on and which were restored from the previous day ...
    thinking it was a server error, since we have several vps and dedicated servers .. i contacted the company who hosts our servers ..
    they looked into it and apparently .. there were no issues on the server side and neither on that particular computer ... but our server hosts told us .. that it is probably browser related and seemed to have something to with a bug with the cache of the browser
    we didn't know what to do .. it was very annoying .. but at that point it only happened once on a hew pages .. so we decided to see what happened the next time
    Next time we did not restore a session with wordpress pages .. but with the google search engine open and on a few other tabs logged into social media .... and as was saidn by our server hosts it was indeed not related to work that we did on pages on our servers ... since that time even the google search engine homepage ... showed us ... moved here
    Can you pease look into it and fix this .. we are doing the same thing as many years on the same computer also a few years .. so it is not anything we do wrong either .. it is most definitely browser related
    so can you please fix it asap .. since when we work on wordpress .. that is not the only thing that goes wrong .. we also have difficulty uploading updates ... when updating sometimes after the update of any particular change on a wordpress page is done ... we are also redirected to a blank page .. so the updated page does not want to load ... in that case we have use our back button ...
    which sends us back to the right page ... but with the old data on it ... then we have to refresh that page .. and only then we see the page updated ... so it seems that there is an issue in both direction with the caching of the browser after the last update
    Kind regards,
    Robert

    uninstalled firefox ....deleted all files still remaining under mozilla firefox directory in program files ... to avoid having to reprogram all my settings, reisntall all addons as well .. I did not remove anything from mozilla firefox that is stored in either appdata or under the windows users directory (if any)
    ... the as suggested reinstalled the latest version of the firefox browser using the link you provided in the email ..; tested and several issues still remain present and unresolved ....
    so please this is urgent or I will have to jump browsers and start using chrome .. because we work 14 hours a day 6 (sometimes 7) days a week, to get ready for the launch of our newest venture and we cannot lose that much days on browser related issues ... so please instead of putting me through week long step process .. of do this .. do that .. can you please actually look into the issue from your end .. I use firefox for so many, many years thta I deserve this kind of support .. thnx Robert

  • Bug in the copy cluster roles wizard - CSV reparse points cannot have names with spaces

    Hi All,
    I have identified a bug in the copy cluster roles wizard in 2012 R2, which is preventing me from migrating my clusters from 2008 R2 & 2012 to 2012 R2.
    The bug surfaces when you attempt to copy a VM role from a 2008 R2 or 2012 cluster that has a CSV reparse point name that contains spaces as follows:
    The role appears to copy across fine, but once you've migrated the CSV and brought it online followed by starting the VM, the VM configuration resource promptly fails along with the VM.
    The issue can be spotted inside the copy cluster roles wizard, where it presents itself by removing all text after the first space in the name to read "C:\ClusterStorage\CSV" rather than "C:\ClusterStorage\CSV
    Test Disk 3" as follows:
    The bug only appears for VMs on CSVs with a reparse point name containing spaces - all other scenarios succeed.
    After searching through the registry on the new cluster, you can clearly see that the VM role hasn't been correctly copied.
    It shows a value called SharedVolumeMappings with the data C:\ClusterStorage\CSV|<guid>|<integer>
    Whereas it should show the data C:\ClusterStorage\CSV Test Disk 3|<guid>|<integer>
    If you modify the data in the SharedVolumeMappings value in both
    0.Cluster\Resources\<VM guid> and Cluster\Resources\<VM guid> keys, the VM will start and work correctly.
    The problem for me is that I have many VMs on many different CSVs all with spaces in the names of the reparse point! Its not feasible for me to go through the registry for every copied VM on every node of the new cluster, as this would take a very long time
    and would be prone to errors that could cause further problems.
    Can anyone provide any help on this? A hotfix for the issue would be great, if anyone from Microsoft is reading :-)
    My deadline to get the VMs migrated to the new cluster is the 21st February, so I would really like to have a solution to the problem before then if at all possible.
    Many thanks in advance,
    Tom

    Hi Subhasish,
    Thanks for the reply, glad that its something that is reproducible!
    Do you have any idea of timescale? Or is it likely that I will have to modify the registry as above to get this working?
    If I am going to have to modify the registry, please can you let me know if the resolution I have tested above is safe and viable? Or are there other settings that I will need to change to make the cluster fully aware of the proper path to the CSVs for its
    VMs?
    Also, is there a known procedure for renaming the reparse point whilst VMs are running on it? This would allow me to negate the issue before copying the roles to the new cluster :-)
    Thanks again,
    Tom

  • Bug Report: The keyboard focus doesn't automatical...

    Bug Report: When a conversation window opens, the focus doesn't automatically land in the chat entry text field.
    Since the new interface for Skype was introduced officially in Skype 7.0, there is a bug with the system/keyboard focus for a new conversation window. When Skype is in "Split Window View" and each new conversation automatically pops up in a separate window, the system/keyboard focus doesn't land in the chat entry edit field. Instead, the user has to press Shift+TAB a couple of times, to move it there and reply to the chat message received. This especially problematic for screen reader users, who rely on keyboard navigation. This mainly occurs when a new conversation is started with an incoming message, but it sometimes occurs when moving the focus out of that conversation window and later back in it again (while it is still opened).
    Steps to reproduce it:
    1. From "View" menu, activate the "Split Window View", if it is not already enabled.
    2. From Tools -> Options -> IM & SMS -> IM settings, enable "Open a new window when I receive a new message in Split Window View", if it is not already enabled.
    3. From Tools -> Options -> Advanced, activate "Enable accessible mode", if it is not already enabled.
    4. Activate the "Save" button, to save the changes.
    5. Close all windows, related to Skype. You may keep only the main window opened.
    6. Tell someone to send you a chat message. When the message arrives, Move the system focus to the conversation window in question, preferably with Alt+TAB. The system/keyboard will not land in the chat entry edit field as it did in Skype 6.21 and earlier and as it should by default, but in some unknown place in the window.
    7. Move the system/keyboard focus in the chat entry edit field and keep it there.
    8. Switch to another window, preferably from another application.
    9. With Alt+TAB, switch back to the window of the opened Skype conversation. There is a chance that the system/keyboard focus will not land in the chat entry edit field as it did in Skype 6.21 and earlier and as it should do by default, but again in some unknown place in the conversation window. But that is harder to reproduce.
    Test environment:
    - Operating system: Windows 8.1 Pro N, 64-bit, in Bulgarian with all locale settings set to "Bulgarian".
    - Skype version: 7.0.0.102 for Desktop.

    This is a known problem, but Skype have not given us an estimated time for a fix.
    Traditionally, Skype updates have been roughly monthly, so we are due a new version sometime soon. Many of us here are hoping that is has a bunch of fixes for the UI, the focus problem being one of them.
    Sean Ellis - uses Skype chat for serious work
    Click here to read my blog post on Skype 7 and basic principles of GUI design

  • I found the solution to a Mavericks bug on the Mail program. How can I share it? Several of my mail boxes stopped functioning properly when I updated to Mavericks. After long hours, I discovered that if I change the name of the mailbox, the content works.

    I found the solution to a Mavericks bug on the Mail program. How can I share it? Several of my mail boxes stopped functioning properly when I updated to Mavericks. The title of the mails stored in the mailbox appear, but the content was unavailable.
    After 4 long hours at the phone with the Apple staff unable to help me, I discovered that if I change the name of the mailbox, the contents of the mails stored there become available.
    Please, make this solution available to other people!

    You have found the the way to share it.   Include your problem and its solution in a forum post in the Mavericks forums.   Then mark you own post with a green solved star.
    Note.  You won't get any points for that; points are only awarded where you mark someone else's post as either helpful or solved.

  • HT1665 There is a bug in the spellchecking functionality when typing in the web view or while using Blogsy App. Why? Why my IPad crashes so often?

    There is a bug in the spellchecking functionality when typing in the web view or while using Blogsy App. Why? Why my IPad crashes so often?

    I have always found spell check to be "buggy" in every version of all of the iOS's that I have run on my original model iPad and my new iPad - especially when replying and typing posts in these forums. It works perfectly in every other application on my iPad but it has never worked perfectly in any web browser that I have used on my iPad - no matter what I have done to try to correct it. That is what MY experience has been with spell check on my iPads.
    As for the crashes on your iPad try these basic troubleshooting steps.
    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    Quit all apps and restart. Go to the home screen first by tapping the home button. Quit/close open apps by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner to close the apps. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.

  • A possible bug in the Accordion scripts

    I've encountered what may be a bug in the handling a single
    apostrophe in the tab of an accordion panel. When I use &apos;
    in the tagged element content displayed in the accordion tab, the
    character appears in the tab but any processing of the panels
    stops. When I remove the &apos; everything is fine. When I swap
    &apos; for &quot; (or any other special character) this
    also works. So I'm thinking the single quote is affecting the
    javascript somewhere along the line.
    I'm using the 1.4 release of Spry.
    BTW, all special characters in the panel content work just
    fine. It seems to be only the tab that is affected when the content
    there contains this single quote mark special character.
    Unless I'm totally out to lunch or this is one of those magic
    things that self-corrects the minute you ask someone a question
    about it (I hate when that happens).
    Thanks for any help you can give me.

    Hi solsenkp,
    I'm not seeing the problem. Can you post some sample markup?
    --== Kin ==--

  • Find a BUG on the SOA Suite ( Internationalizing Problem)

    I am a java developer in Thailand.
    I have 4 Java Certifications - SCJP, SCWCD, SCBCD, SCJWSD.
    I meet something wrong ("bug") when I play with Oracle SOA Suite.
    About my technical software :
    -I use the Oracle Database XE (Universal).
    (I cannot use the HTML DB to run your script from soademo_101310_preview - it's give me the error messages so I change to run the SQL from command. Although running the SQL script from the command line is O.K., the command window is not support the Thai language. It appear in Alien language that I cannot read.I try to change the command window option but It has only 2 font choices. Thus I cannot still do with Thai language in the command window.)
    In control panel, the regional and Language Option, I set the standard and format to Thai (including Language for the non-Unicode program in Advanced Tab).
    I am successful both insallation and deploy the SOA book application.
    I follow the instruction in Oracle SOA Suite Quick Start Guide, 10g Release 3 (10.1.3.1.0).
    At the page 39, I find a BUG.
    My created date on the BPM Worklist is wrong !!!
    My computer time is 10 &#3585;&#3633;&#3609;&#3618;&#3634;&#3618;&#3609; ( September in Thai language) 2549 (Buddhist Time).
    But the date I see in the BPM Worklist is 10 &#3585;&#3633;&#3609;&#3618;&#3634;&#3618;&#3609; ( September in Thai language) 3635 (Buddhist Time).
    You can see the image at http://img178.imageshack.us/img178/5487/datehp3.jpg.
    I have 3 questions :
    1. How can I add the Thai font in SQL command line window (SQL*Plus) in Oracle XE ?
    2. Why does the HTML DB not support to run the uncomplete sql script ?
    3. Have any suggestion to correct the time problem. ( Internationalizing Problem) ?
    Thank you very much.

    This is not a bug.
    The timezone is based on the user profile.
    You are using jcooper, whose timezone setting by default is set to be
    <timeZone>America/Los_Angeles</timeZone>
    Please double check the
    ORACLE_HOME\OraBPEL_1\bpel\system\services\config\users-properties.xml
    jcooper should have settings like this by default:
    <name>jcooper</name>
    <description>Demo User</description>
    <email></email>
    <title>Loan Agent 1</title>
    <firstName>James</firstName>
    <lastName>Cooper</lastName>
    <manager>jstein</manager>
    <timeZone>America/Los_Angeles</timeZone>
    <languagePreference>en-US</languagePreference>
    <notificationPreferences>Mail</notificationPreferences>
    Message was edited by:
    user530868
    Message was edited by:
    user530868

  • When my iPod Touch is connected to my Mac, and I select Update to update the software of my iPod Touch, I get a message saying that my iTunes software is current, but it will not update my iPod Touch software.  Is there a bug in the iPod program?

    When my iPod Touch is connected to my Mac, and I select Update to update the software of my iPod Touch, I get a message saying that my iTunes software is current, but it will not update my iPod Touch software.  Is there a bug in the iPod program?

    If you have the first gen ipod touch as your information shows, then you would have to buy a software update:
    Purchasing iOS 3.1 Software Update for iPod touch (1st generation)

  • My JPEGS are no longer being copied over to Finder.  Only a random fraction are copied.  It use to work perfect.  Is there a bug in the updated versions of iPhoto?

    My JPEGS are no longer being copied over to Finder.  Only a random fraction are copied.  It use to work perfect.  I can move them 4 or 5 at a time, but it is very time consuming.    Is there a bug in the updated versions of iPhoto?

    OK - here is what I've done in the past.  As I want to be able to save my photos on  a DVD that can be read by both a PC and a Mac, I am burning them in Finder.  I start by downloading into IPhoto.  I'll flag and edit the ones I want to print or post to the web.  After that I want to take all the keepers and move them from IPhoto to various files I create in the document  section of Finder.  I've done it both ways in the past, copy and paste or just drag over, all the files would transfer over.  Now there may be dozens of pictures that do not move over - very random, in one case there were only 6 photos and the 3 vertical ones did not copy over.
    I'm wondering if this is a software issue or if there is just too much data being moved around.  FYI there are 2 Nikon cameras I use and the files from both do this.
    Thanks

  • Is this a possible bug on the Facebook app for iPhone?

    I tend to suffer from slight paranoia regarding security online and on my phone. I'll try to explain the worry I'm having as best I can.
    Basically, I had a personal video on my phone, (nothing horrible don't worry), but it's of a nature that would be embarrassing to be seen by other people.
    So this video was the latest thing I had recorded/taken with my phone. I went onto the Facebook app on my iPhone to post an older picture I had to my page.
    When I saw that this video was still on my phone, I panicked and worried that it could somehow get posted to my page without me actually posting it e.g. a bug whereby the last picture or video taken would go onto your Facebook without you actually selecting it or posting it. So I deleted it while still on the grid page where you choose your photos/videos and so it disappeared when I went back to the app.
    Can anyone with 100% honesty tell me one way or another if this is possible? If I haven't explained it enough let me know and I'll explain it further. Again, please be honest cos it's the best thing for me. Thanks.

    It may be in Facebook, but Facebook doesn't consider it a bug; it's the way Facebook works. If you gave the app permission to view your photos it gives Facebook access to ALL of your photos. To put your mind at ease go to your Facebook page on your computer and see if it's there.
    If you are concerned about privacy online you probably shouldn't have a Facebook page

  • My external hard drive (1TB WD My Book Essential) suddenly has no room to backup with Time Machine! I am using Maverick OS and wondered if it is because of a bug in the system software.

    My external hard drive (1TB WD My Book Essential) suddenly has no room to backup with Time Machine! I am using Maverick OS and wondered if it is because of a bug in the system software. I purchased a new external drive with 3 TB and wonder if I will run into a problem installing it. I don't know how to transfer my files from the previous HD to the New one. I was told to use a cable, but how do I do it? Do I connect them both to the computer and drag the old into the new? How is it done?  Why did this happen, the overloading of the Time Machine?

    Why has the TimeMachine drive run out of space?
    With the limited amount of information you've provided it is hard to answer this question. TimeMachine should continue making backups until the drive is full and then it should erase the oldest backup(s) to retrieve enough space for the next backup. Unless your computer's hard drive has close to 1TB of space on it, you shouldn't see a message saying TM cannot backup because it is full. However if you do have more than 500GB (1/2 a TB) then I can see how that message might occur. Also, if you are using the TM drive for double duty (backing up more than one computer or storing data other than TM) you could get that message.
    Will you have this problem with a 3TB drive?
    I always recommend that people look at how much they'll be backing up in total, add a bit extra for the future, and then multiply that by at least 1.5 and even better to double it. That indicates how large the TM backup drive should be. The TM drive should only be used for TM backups. It is ok to use one drive to back up  more than one computer but if doing so, add up the contents of all the computer drives, adjust for the future and then double it.
    Moving Forward
    Disconnect the old TM drive for now. Connect the new drive and let TM do its job. I don't recommend that you try to transfer the TM backup from the old drive to the new one. Keep the old drive around for a couple months just in case you find you need it and then after a few months, if you like, you can erase it and use it for something else.

  • Who can help me to submit this bug to the adobe indesign development team?

    I developed a indesing plug-in, and its function is to increase the two kinds of footnotes style,
    When the user selects this type of footnote style, and insert some footnote to the document
    The user then export the document to pdf。
    there is no  problem in indesign CS3 and indesign CS4.
    but in indesign CS5 and CS5.5,
    export pdf, there will be two kinds of format:
    Adobe PDF(Interaction)
    Adobe PDF(Print)
    If the user chooses to export a pdf(Interaction),there is no problem,
    but if user choose to export to pdf(print),
    All of the footnote is replaced by an ordinary Arabic numerals 1,2,3,4,......
    I think there is a bug in exported the pdf function in cs5 and cs5.5,
    so ,who can help me to submit this bug to the adobe indesign development team? thanks.
    Through the link below to download a trial version of this plugin for indesign cs5
    http://www.cppblog.com/Files/lyj2871/1380_CS5.rar

    who can help me?

  • App Stores' bugs on the iPhone 2.0

    Hello,
    I have a first generation iPhone and I found a couple of bugs with the App Stores:
    1) Going to "Featured" and then to "Categories" in the top right makes my iPhone go back to the main menu. Seems like the App Store application crashes.
    2) Leaving reviews for applications using iTunes works fine but when I use the iPhone none appear on the review list, even after waiting a couple of days. Something is definitely not working here.
    3) When in the "Top 25" tab, the number of reviews listed for each application is outdated. I need to load the reviews of a single application to get the number of reviews on the "Top 25" list to update for this application.
    I also wonder why some applications are not available where I live. I do not have access to Loopt, eBay or Pandora from Europe. I understand for Loopt as it is an application based on the location, that works for the US, but Pandora is a internet radio so it should be available everywhere. As for eBay, I am pretty sure it is only a matter of changing a few lines of code so that the application shows the listing of my country.
    Don't you think it would be nice to have a single topic with all the bugs related to the iPhone 2.0 software update? What do you think?

    First gen phone running 2.0
    1) When an app kicks you back to the home screen, yes, that's a crash. But I haven't seen the App Store crash on me at all. There is no Categories button in the top right of Featured, but switching between the top buttons doesn't cause me any problems.
    2) I haven't tried leaving reviews via iPhone, so don't know.
    3) Yes, I'm noticing a difference in review number. The Top 25 list shows N, the app page shows N, and then when you actually load the reviews, the heading at the top shows N-plus-something. I'm only seeing this with some apps, though, and the ones that do show it are off by a fairly small number (1148 vs. 1157, 254 vs. 258, 8 vs. 19)
    A single topic for all bugs is a bad idea---it would quickly get too unwieldy and confusing. Much better to have small direct questions with specific subject lines.

Maybe you are looking for

  • I can't find 3D option in Photoshop cc or cs6

    Here is the sistem info. Adobe Photoshop Version: 14.0 (14.0 20130423.r.221 2013/04/23:23:00:00) x64 Operating System: Mac OS 10.9.2 System architecture: Intel CPU Family:6, Model:37, Stepping:5 with MMX, SSE Integer, SSE FP, SSE2, SSE3, SSE4.1, SSE4

  • Old purchased folder transfer to new computer

    I have a new computer and after I transfered all my music from the old computer to my new comouter the purchased folder on the new computer was empty. How do I fill the folder with the music I purchased before the file move without going through all

  • IDOC failed

    HI SAP Guru, I am working on ECC-6.0 version. the Purchase Order gets created from ME59. The program has been schedule in background to create a PO. EDI message type has been Define. Thus IDOC gets created successfully. BUt some times it fails & give

  • Query Designer: Execution Fails

    Hi Experts, Iam not able to execute my query in BExWeb. It is showing following error. iView : N/A Component name : N/A Access denied (Object:portal_content/com.sap.pct/platform_add_ons/com.sap.ip.bi/iViews/com.sap.ip.bi.bex). Exception id: 02:47_19/

  • Best Practices for data storage in portal database

    Hi, I need to store some stuctured data which is related to portal only. This data may grow data by data and may huge amount some point of time. Iam thinking which is the best way to handle it like maintanance point of view. i think i can store it in