Calendar Is it a bug

Our application was working fine till recently before upgarding to JDK1.3.1_03. I am having problem with Calendar Object.When I set a month, I do not seem to be getting the correct output
I am pasting the sample code below.
Calendar calendar=Calendar.getInstance();
calendar.set(Calendar.MONTH,3);
System.out.println("date is "+calendar.getTime());
I would expect a Date with April as month. The output is
"date is Wed May 01 11:12:01 PDT 2002" which is not correct.
I tried with
Calendar.set(Calendar.MONTH,5); and the output is
"date is Mon Jul 01 11:17:51 PDT 2002"
However with
Calendar.set(Calendar.MONTH,4); and the output is
"date is Fri May 31 11:19:40 PDT 2002"
The problem appears to be confined to even months such as Feb,Apr,June etc.
Is somebody else is facing this problem? Should I report this as a bug?
Any Pointers to this will be appreciated.
Thanks

Thanks for the reply. This is done programmatically.
Imagine you are getting a date object from database and I need to display this on a calendar bean in terms of Month,Year and Date fields. All I do is create a Calendar instance and set it's date to be this date object and pass this to the calendarbean which will pass the month value to month bean,date value to date bean and year bean to year bean for their display .Individual beans update their values by setting their calendar objects.The probem comes when month bean gets value of 2 for the month and it is unable to show the correct month.
This piece of code pasted is for example only not be used literally.
I also tried using your suggestion by calling
Calendar calendar=Calendar.getInstance();
calendar.set(Calendar.MONTH,Calendar.APRIL);
System.out.println("date is "+calendar.getTime());
and the output is
"date is Wed May 01 12:01:19 PDT 2002"
Hope you understand.

Similar Messages

  • How do I print calendar with out any bug in

    I tried to print my calendar and every time it does not print my calendar the way I wrote it.  for exemple, if I put 3 names in one day and change the order the next day and so on and foward, it print it all mixe up and when I come back to the calendar, everything is OK like I wrote it.  I thing it is a bug in Ical but maybe somebody can tell me what I'm doing wrong.
    Thanks
    Clément Lapointe

    Please refer to this (extremely lengthy) thread, all possible options have been covered here: https://discussions.apple.com/thread/5460803?tstart=0

  • EMAIL AND CALENDAR ACCOUNT STATUS ISSUE / BUG OS 10.3.1

    I found an issue / bug which is really frustrating me!
    Phone:      Blackberry Q10 (SQN100-3)
    OS:           10.3.1.1565
    Mail:          IMAP
    Calendar:  Google Calendar
    Last week I updated my BB Q10 to the new officially released OS 10.3.1
    Today I noticed that the connection info / status for email accounts and calendars (Settings > Accounts) wasn’t indication correctly.
    In the Accounts menu it shows “E-mail” below the name of my email account and “Calendar” below my calendar account to indicate that my Q10 is connected to these accounts. But when I turn airplane-mode on it still shows E-mail and Calendar without being connected to any of these accounts.
    Strangely when I turn on my phone while in airplane-mode the Accounts menu shows “E-mail” for my email account and “No Connection” for my calendar account, obviously without being connected to my email account. But when I turn of airplane-mode I receive emails and new appointments but the Accounts status for calendar still shows “No Connection”.
    Apparently the account status is not updated while using my phone, it shows the status at startup. This is very annoying and I am unable to check whether I am connected or not to my email and calendar while not in airplane-mode.
    In OS 10.2.1 the account status worked correctly and was updated (connected / no connection) while using my phone.
    Anybody else with the same problem?
    Is this already a known issue / bug?
    Anyone an idea how to solve this issue?

    I would simply delete both accounts (email and calendar) then readd them.
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • Leopard iCal "Calendar Cache" subscription refresh bug persists in 10.5.3

    The 10.5.3 Leopard update does NOT fix the infamous Leopard iCal "Calendar Cache" bug, as discussed in http://discussions.apple.com/thread.jspa?messageID=6660830 .
    This bug, introduced with Leopard, prevents iCal from picking up modifications to events on subscribed calendars. The workaround is to delete "~/Library/Calendars/Calendar Cache" and then refresh calendars. The file deletion can be done automatically by a login Automator script as suggested by a contributor to the thread linked above.
    This to me is one of the most embarrassing bugs introduced with Leopard. It has high impact (prevents use of iCal in an enterprise setting) while appearing to be a very simple bug and thus most likely very easy to fix.

    Hmm, I did not get the "Calendar Cache could not be moved" message when I updated to 10.5.3.
    The bug I'm referring to is different. It is a persistent bug in all Leopard versions to date. It prevents iCal from detecting modifications to subscribed calendars.
    For example, say you subscribe to a baseball-game schedule. The organizers decide to change the date of a game in the calendar server. But you arrive at the field on the original date, surprised that you are the only one there. Why? Leopard iCal relies on stale cached information EVEN WHEN EXPLICITLY TOLD TO REFRESH SUBSCRIPTIONS.
    The only way around it is to delete the "Calendar Cache" file and then ask for an iCal refresh ON A REGULAR BASIS since otherwise you don't know if subscribed events have been modified or not.
    Or, use SunBird.
    I don't think this has anything to do with the "file cannot be moved" error some folks are apparently seeing as part of the update to 10.5.3. That probably deserves its own thread?

  • Mountain lion calendar smart event adding bug for 24h clock

    I have checked it with Polish locale settings but problem should be everywhere when 24h clock is selected:
    When adding event "alarm jutro o 5:00" (means: alarm tomorrow at 5:00) - Calendar app is adding alarm at 17:00 not 5:00. Seems to be bug.

    Under System Preferences > Date & Time, click the "Clock" tab near the top and check "Use a 24-hour clock".

  • IPhone 4S (iOS 7.1) - iCloud Contacts/Calendars dissappearing

    Hey guys,
    I was wondering if you guys had this same problem. I searched around Google and in this community, and it seems like you guys also do. I'm going to create a new thread with more details below..
    Basic Info:
    iPhone 4S (Chinse (CN) phone)
    iOS 7.1
    I'm an American working in Shanghai, China.
    Issue:
    At random times and at least 3 times a month, my contacts and calendar events would dissappear.
    When it disappears, ...
    I see only phone numbers in the Phone application and when someone calls me.
    My Contacts app only list like 5 out of my 230+ contacts, I dont' know why only these 5 were not affected. This is my iCloud contacts.
    My Calendar is empty and no longer shows which Calendar I can hide or show. I had 3 different calendars (iCloud, Personal, and Work calendars)
    After about 2 hours (or even longer), the Contacts and Calendars will slowly return as it tries to download from the iCloud server (I can see the loading animation in Calendar and the contacts slowly showing up). Sometimes it doesn't return after 2 hours and I have to manually force it by turning OFF and ON the calendars sync.
    Already tried:
    Restarting the phone (soft shutdown and hard shutdown by Home + Power)
    Already checked to make sure iCloud, Contacts, and Calendars is ON in Settings
    Already tried turning them OFF, wait about 10 minutes, then turn it back on. Sometimes it loads back the data, sometimes it doesn't. Right now, I have my work calendar missing.
    This bug happens seem to happen only when I'm on Wi-fi. Didn't see it happen on 3G yet. Not sure, but it seems to happen when I switch from 3G to Wifi automatically when I got home. Need to confirm this.
    Tried syncing to iCloud to see if it comes back, 1/3 of the time it would.
    History w/ this bug:
    I had this phone since iOS 6.
    This bug first appeared in iOS 7, which also happened at least 3 times a month. I reported this directly to Apple Support, but not sure if they read it.
    In iOS 7.0.x, this bug stopped reappearing. Seems like they heard us and fixed it. I never had this issue again.
    In iOS 7.1, this bug resurfaced and now is haunting me again.
    Other cases?
    My iPad 3 iOS 7.1 is from Hong Kong, doesn't have this bug and I use the same Wi-fi connection as my iPhone.
    My girlfriend has an iPhone 5 iOS 7.1 (US) and iPad mini 2 (CN), she didn't experience this issue.
    My colleagues has Chinese phones just like mine (iPhone 4S w/ iOS 7.0 and iOS 7.1), didn't have the issue.
    Searching in Google and this community, it seems people are expering the same issue.
    I am doubting that this bug has anything to do with my hardware or my settings. I feel this is a iOS software issue. Please let me know what I can do to help as I've already tried everything I can think of.
    Thanks,
    Bruce

    Within Contacts, tap Groups at top left. Make sure all contact groups are checked to show, then tap "Done" at top right.
    Within the Calendar app, tap Calendars at the bottom center of the screen. Tap on Show All Calendars.

  • Manual calendar migration Mavericks?

    I upgraded to Mavericks from Snow Leopard, but things were slow and also decided to add an SSD to my iMac and do a clean install of Mavericks.
    All went well, but I forgot to export calendar. I found my calendars on time machine (an older backup) located in /users/username/library/calendars but when I grab this folder and copy it over to the same location on my new HDD and restart calendar, none of my new calendars appear.  These are all local calendars - no cloud syncing or any other cloud services. I see all the ICS entries in the folders.
    After I copy all the old calendars over - the Hex/Alpha names - when i reopen calendar it creates new calendars in the folder for the default calendars but ignores the old ones i restored.
    Any ideas?

    I found a work around... but unless someone has a better way, I am going to assume that the Mavericks calendar has some serious bugs...
    1. Create new calendar
    2. Make the new calendar the default
    3. drag and drop ical files from old calendar folder directly onto the calendar window
    It is not enough to just check the calendar you want to add events to, it must be made the default. I
    f you leave open the calendar preferences window, you will receive an error during an import that it can't read the calendar event... something wrong with it. At this point some ical events import, some don't - even after closing the preferences window. Only fix is to quit Calendar and reopen.
    Good news is you can re-import (drag and drop) the same ical event many times, and only get it to appear once.
    The key is changing the default calendar before doing the drag and drop so your events make it to the proper calendar.
    This really should be fixed... somehow it must be tied to the whole cloud thing - but I should be able to just copy over my calendar folder from my old machine.

  • HTMLDB v1.6 bug spreadsheet import wizard

    Hi HTMLDB Team,
    A major HTMLDB 1.6.1 bug found as follows:
    The problem found when importing data thru Spreadsheet wizard of Data workshop.
    Say, i have a table where with other fields the two more field added as created_by and created_date.A trigger is created on that table to keep track of user and time
    so before insert of any row that two field created_by and created_date will be updated.But if i have created_by field with 10 varchar but the actual user name came as 20 varchar from a spredsheet csv input. unfortunately while updating other column from csv the trigger first got disabled and then update other column but actually in ideal condition it must throw error mentioning that the field length must be large than the present one.So finally the other fields updated while trigger is not fired.
    So HTMLDB team must notice the runtime error throw by the spreadsheet data import wizard.
    Any further issue how to get rid of that kind of runtime?
    Hope in future release that bug can be fixed.....
    Cheers,
    Eman

    Just tried on htmldb.oracle.com (1.6.1) and it doesn't work.
    I created application 45782 in GLENMORRIS workspace, with a very simple calendar which allows clicking on an item and it links to the same page and displays the selected value.
    Exported this app and imported under new application id 22563. The new application no longer has the link in the calendar.
    Searched the bug database in metalink and couldn't find anything.
    Any ideas on this?
    It looks like I may have to edit our production application as the link has gone missing between the export from test and the import into prod.

  • ICal - MobileMe - Duplicates, Triplicates, etc. - gone crazy?

    Have been using MobileMe for over a year now, "almost" no problem, but since 2-3 weeks out of control: I use it to sync calendar and address book across MacBook Pro, iPad and iPhone 4 (sync only over MobileMe, not over iTunes). Since 2-3 weeks the calendar entries multiply dozen of times with no reason. E.g. enter one meeting in the iPhone, then find it dozen of times in MacBook and iPad. Also the other ways round.
    Have reset all sync and deleted all calendars, no impact. Bug in MobileMe or am I missing a hidden setting somewhere? Please help.

    Greetings,
    How many computers are you syncing?
    If you are running the latest version of the Mac OS on all the computers and the latest version of the iOS on your iPhone you might want to consider using the new MobileMe calendar. The issue you describe sounds like a sync database issue. The new MobileMe calendar does not use syncing anymore so this might be a cleaner solution to the issue.
    Review this article for more information on the new calendar: http://support.apple.com/kb/HT4379

  • Mac mail not working with gmail 2 step verification in yosemite

    Every couple of days my 2 step verification seems to drop off the mac mail (and calendar) radar. Ive been using mac mail with 2 step verification (gmail account) for about 8 months, no problems. About 1 month ago my mac started asking for my gmail password. I have revoked and regenerated my password about 6 times recently to try to overcome this issue. The new password works for a couple of days and then mail and calendar start asking from my password again.

    Not quite a reply, but I'm not sure how best to add to my first comment.
    One of the issues with this (and there are multiple) is that I can't use handoff to work on something on my mac, started on my ipad, if it is working through my gmail account eg notes, calendar, email.
    This bug is totally crippling the productivity and flexibility that came with ios8/yosemite developments.

  • Father's Day missing

    Why is Father's Day missing from the Mavericks version of Calendar (US Holidays)? It has Mother's Day...

    tohai wrote:
    Why is Father's Day missing from the Mavericks version of Calendar (US Holidays)? It has Mother's Day...
    It's in the Australian Holiday Calendar so just a bug in the US version I suppose. Tell Apple feedback
    Or if it is making your life unbearable then file a bub report  Report Bug
    Good Luck
    Pete

  • All day calendar events not being displayed in the notification centre for iphone 5 post ios 7 upgrade. Please help. Is it a bug?

    All day calendar events not being displayed in the notification centre for iphone 5 post ios 7 upgrade. Please help. Is it a bug?
    With iOS 6, the all day events showed up in the notification centre but it lacks in the upgrade iOS 7.

    Same problem here. Some people pointed out that all-day events do show up in their notification center, but that seems only to be the case for birthdays (and only as text like the weather). I've tried it myself on my iPhone and iPad and it did work for birthdays but not for any other all-day events. I already sent this to Apple as a product feedback as well, as should everyone of you. The more people mention it, the faster Apple's going to fix this issue. In its current state, notification center is not a very helpful feature in my opinion. There's absolutely no point in not showing all-day events in the 'today' calendar overview.
    Here's a link to the product feedback page: http://www.apple.com/feedback/
    I posted my message in the iPhone section since I couldn't find a page specifically dedicated to iOS 7.
    I really love the look & feel of iOS 7 but it's kinda sad to see notification center not tapping its full potential.
    Cheers!

  • Syncing iPhone and Outlook Calendar - bug?

    I have an issue syncing my iPhone 3G Calendar with Outlook’s Calendar (Outlook 2007). In general, the sync works fine, but: If I delete the current (ie first) instance of a repeating event in Outlook, when I sync, my iPhone will still display ALL instances of that event, including the ‘deleted’ one.
    I have verified that this is because the iPhone is syncing the event based on its start date in Outlook, which will include the ‘deleted’ event, rather than what actually is shown as still a valid event in the calendar (which of course is what I want).
    I am guessing that this is just because both manufacturers are pursuing a different methodology, but the bottom line is that iPhone claims it will sync properly, so I’d call it a bug.
    I have a workaround, in that I can delete events from the Outlook calendar by changing the start date to the current one I wish to display, but this is cumbersome and of course takes more time. Is there a more elegant workaround? Or am I just doing something wrong?

    When you decide to sync the second computer to the iphone, itunes will ask you if you want to merge or replace the data.
    In the merge, data will be transfered both ways.
    So, when you say separate, you can sync them one at a time, but in the end, all the events will be the same on both computers and iphone. Because itunes keeps merging the data.

  • 701 Mail, Calendar, Social network and Web bug.

    Hello
    im pretty satisfied with my 701 but just right now i started to experience bugs. let me explain
    Calendar- sometime (always when i go through widget) when i open a calendar, it opens a speciffic day (the one that is actual), and im unable to select month or any other view point, and i cannot see any of my notes in the calendar until i restart my phone.
    Mail- widget sometimes doesnt refresh inbox even though i have it set on 15 mins. (happend last time for a week. thought i had no mail, instead i found 10 new messages.) also sometimes my mailbox wont open using widget, only with a normal Email icon.
    Social network just doesnt want to open at all. says (in translation something like "Unable to launch the client"
    Web- even though i have 3g network signal and mobile data are turned ON, opera mobile, and Web client (the nokia one) both cannot connect to the internet for some time.
    i tried backing up my phone data (not applications only galery, phonebook, music, ebooks etc and videos) and erasing (reseting) my settings. when i turned my phone on again, it asked me to enter time, date, my nokia account etc. as if i just bought the phone. then i loaded my backup files. email looks like its working again, calendar got stuck just today again... social network still doesnt work, web still cannot connect to 3g network sometimes.. 
    dunno what else to try, starting to be little angry, since calendar and web are the things i use more often then sms and calls. 
    is this common? will there be an update to fix this? or is there a simple solution to my prob?
    i would add an attachment supplying info about my phone but i have no idea where to get such file.
    thanks for help.
    Solved!
    Go to Solution.

    No problems here!  
    Any way the Feature Pack 1 will solve those problems ...  

  • ICloud changes my calendar colors.  I am no longer able to pick my own calendar colors.  This is due to some bug on iCloud.  FIX THIS PROBLEM IMMEDIATELY APPLE!!!  THIS IS RIDICULOUS.  iCloud should not force us to pick calendar colors.

    iCloud changes my calendar colors.  I am no longer able to pick my own calendar colors.  This is due to some bug on iCloud.  FIX THIS PROBLEM IMMEDIATELY APPLE!!!  THIS IS RIDICULOUS.  iCloud should not force us to pick calendar colors.  We should be able to pick our own!!!!!

    Same here, Calender keeps reverting to Purple a color I never ever even picked, screw you iCloud, you continue to annoy me and baffle me with your inadequecies

Maybe you are looking for