Date change problem in Calendar object

Hi i have a calendar object for date representation.
When i need to go ahead a day i use a add method that adds a day to the Calendar object, and if the date is out of range it adjustes proerly to the next montha and proper date in that next month.
But it fails for 2 instances in a year.
From May to June and From October to November.
This i think is happenning because of the Daylight saving times in the May and October.
I try to go from May to June but it never does on it's own !! Do i have to explicitly check that for those 2 months or there is any other method ?
How can i get over it ??
Please help me with this.
Shailendra

Hi
There may be some other reason for it, coz Day light savings starts in last week of March, not in May.
And day light savings ends in Last week of October
Suresh

Similar Messages

  • Changing TimeZone for Calendar object doesnt change its time

    Hy, I have a Calendar object with I have set with a Date but I I want from this calendar with the Date set, set other timezone for this calendar and get the corresponding time(always gettting the correct time if is in daylightsavings) but I get the same time.
    Calendar calendario = Calendar.getInstance
    calendario.setTime(new Date());
    System.out.println(calendario.getTime()); *// for example I get the 14:12:25 hours for GMT+01:00*
    calendario.setTimeZone(TimeZone.getTimeZone("GMT+02:00")); *//change time zone using GMT*
    System.out.println(calendario.getTime()); *// I get the same hour: 14:12:25*
    Why? How to do it using GMT format?
    Thanks
    Edited by: user13162080 on 13-sep-2011 14:31
    Edited by: user13162080 on 13-sep-2011 14:48

    user13162080 wrote:
    Ok, thanks. The last question, this changing of timezone and the hour I am getting, is respecting the timezone daylight saving?, I mean if the TimeZone I set is in daylight savings, I will get the correct hour according to this?What DrClap said.
    However, I think you still may be under some misapprehension about time zones:
    1. A Date does NOT have a timezone, even though it stores a date/time value.
    2. Setting a Calendar's timezone does NOT change the time stored in the Calendar. You may even need to run its complete() or computeFields() method to have the timezone change reflected in all its fields (not sure).
    3. As DrClap said, if you are using a DateFormat to display the Calendar, you need to set its* timezone in order to see what you want (for reason 2 above).
    It's amazing to me that after 10 years this API still gives so many problems (and believe me, you're not the only one).
    One thing you might also want to do is have a look at [url http://joda-time.sourceforge.net/]Joda Time. It's been around for a long time now, and so is quite mature; and is fully interchangeable with standard Java date/time classes. In fact, many of its ideas were under consideration for Java Version 7 as JSR-310, but were decided against (still not quite sure why, as in my view the current API is very poor).
    Winston

  • Date change problem on 6110 Navigator

    Hi,
    On Sat morning I noticed my phone had not changed date and still showed Fridays date, yet the time was correct. I changed the date to Sat, and again on Sunday I noticed the same thing - still showed Saturdays date. On Monday and other days of the week the date changes correctly to the next day.
    I tried setting the clock to 23h59 on Friday and watched the date change to Saturday correctly. I also tried this with the phone off and it was correct. Yet if I leave it to run its course there is a problem.
    Can't find any help with this on the net and hoping someone else has experienced this and knows how to fix it. I have the latest firmware for this phone.

    Mine is set to off and always has been. I don't know if my network actually broadcasts time / date for update anyway.
    Either way the phone is OFF when the date change is supposed to happen so cannot get incorrect time from network.
    I have also tested with the phone off. i.e. Set time to 23h59 on Friday, switched off phone and when I switched it back on again the date was correct. Don't know what the difference is between this and just leaving it to run as normal. Its all too weird.

  • Batch date change problem in iPhoto

    I have hundreds of printed photos I scanned in 2009. Even though they were taken over three decades iPhoto thinks they were all taken in 2009. I separated them into years, numbered them, and put them in folders which became events. I tried using batch date change -- the first one in the event is OK, but the others changed  all different. Example: I changed picture one, in event folder "1999" from 3/5/2009 to 1/1/1999. All of the rest of the pictures changed to the same time difference that they were when I scanned them. I didn't scan them all in chronological order, so that doesn't help at all. Do I have to manually change each of my 9000 photos? This is a problem when I try to show a chronological slide show on Apple TV.

    Scanned photos do not have an EXIF Capture Date field in the file like photos taken with a digital camera do.  Therefore iPhoto uses the file created date or import date for those photos.
    You will have to group all 1999 photos into an album, arrange them in the order you want and then use the Photos ➙ Batch Change ➙ Date menu option and add a 1 minute or so between photos.
    Then do the same for the next year's photos.
    OT

  • ORDERS05 IDOC - ZTERM "Critical credit data changed" problem

    Hello everyone!
    I have configured a scenario where XI sends an IDOC (ORDERS.ORDERS05) to an SAP system to create a Sales Order (SO).
    I have a problem with the Payment Terms (...EDI_DC40/ZTERM) field. Whenever I send an SO with the ZTERM field mapped, I get an error "Critical credit data changed" and as a result, the SO is not created; however, when I leave the field blank, the message goes through successfully.
    Apparently, a popup saying "Critical credit data changed" shows even when creating SOs manually. My question is this, is there any way I can bypass this message through XI, so that I can create the SO with the ZTERM field populated? Are there any qualifiers I should be looking into?
    Looking forward to your responses!
    Warm regards,
    Glenn

    Hello Anil,
    Thank you very much for your reply! Unfortunately, that configuration is part of the auto credit checking. When I create SOs manually and change the payment terms field, a popup says "Critical credit data changed", I can simply tick the 'check' mark and the SO saves. However, if the SO is sent via XI, the popup causes an error. Is there any information we can provide in the IDOC so that it bypasses those kinds of popup messages?

  • Help! problem with Calendar objects.

    I'm trying to figure out somebody's age based on their birthday inputed in MM/DD/YYYY format. I've created two Calendar objects; now, dob. I initialize both of them using the getInstance() method than I set the year, month, and day fields for dob to the user inputs. Then I subject the number of years between them(eg. 2005 - 1984 = 21). Then I add 21 to the year field for dob and compare that to now to see if the day has passed yet this year, and if it hasn't I would subtract 1 from 21 to get the age.
    I use the before() method to see if now is before dob, which returns the answer I want except for when the dob's month is the same as now's month.
    When is use 10/10/1984 I get the age as being 20 but it should be 21, however if I use any month before Oct. I get the correct age.
    Here's the code I'm using, any help would be greatly appreciated.Calendar calendar1;
    Calendar calendar2;
    int age;
    calendar1 = Calendar.getInstance();
    calendar2 = Calendar.getInstance();
    // the following three lines would be user input
    calendar2.set(Calendar.YEAR,1984);
    calendar2.set(Calendar.DAY_OF_MONTH,1);
    calendar2.set(Calendar.MONTH,10);
    int currentYear = calendar1.get(Calendar.YEAR);
    int birthYear = calendar2.get(Calendar.YEAR);
    age = currentYear - birthYear;
    calendar2.add(Calendar.YEAR, age);
    if(calendar1.before(calendar2))
        age -= 1;
    System.out.println(age);

    When is use 10/10/1984 I get the age as being 20 but
    it should be 21, however if I use any month before
    Oct. I get the correct age.Probably because January is month 0 according to Calendar. So when you do
    calendar2.set(Calendar.MONTH,10);you are actually setting the month to November.

  • Deferred task date change problem

    Hi,
    Every user in IDM has a deferred task as shown below. The requirement is to change the 'Date' value to set the time as 23:59:59.00Z.
    At the moment different users have different times set for them. All need to be same as mentioned above. Please assist me in this with a faster way as there are more than 5K users.
    <Object name='WF - Expire Contractor'>
    <Attribute name='authorized' value='true'/>
    <Attribute name='date'>
    <Date>2011-04-14T06:00:00.000Z</Date>
    </Attribute>
    <Attribute name='executeOnce' value='true'/>
    <Attribute name='owner' value='C670635'/>
    <Attribute name='subject' value='ProxyAdmin'/>
    <Attribute name='task' value='WF - Expire Contractor'/>
    </Object>
    Thanks,
    Santoshanand

    A code in xpress would be of great help.But much more lines of code :-(
    I am not sure if we have any already existing java or need to write
    a new one. So, I think writing a custom workflow will be a good way.I avoid writing XPRESS code unless it is absolutely necessary, so here I cannot help you :-( I think a
    stand-alone Java program of ~20 lines would complete your task.
    Also, task.setStartDate(<the date>); requires a date object. Problem
    here is to set the time to 23:59 for the same date.
    (new SimpleDateFormat("yyyy-MM-dd hh:mm")).parse("2011-04-14 23:59", new ParsePosition(0));

  • IPhoto Time/Date Change problem

    There is one particular event in my iPhoto program that registered the wrong date when downloaded.  In trying to change it, the program automatically sets the date about 130 years earlier, regardless of what date I type in.  It only happens with this one file.  I have had to change others and they have worked fine.  Does anyone know how I can fix this problem?  After repeated attempts, I'm back to the 1600s!

    How are you trying to change the date? iPhoto has two methods - "Photos > Adjust Date and Time" and "Photos > Batch Change > Set Date and Time".
    If you not yet have tried "Batch Change", try if that will help, if you use the option "Modify Original File".
    Only "Batch Change" will set all selected photos to the same date and time, with an optional increment. So you to correct the images in groups of photos taken at the same time.
    Regards
    Léonie

  • Back date change problem in run result

    Dear Experts,
    Navigate:
    Work Structure>Organization>Description
    i implement organization structure Jan 2010 in R12 HRMS Global . now change appear in organization structure effective date Jan2011. but this change not done till date in system. i date track to 01-Jan-2011 and create new organization structure (Work Structure>Organization>Description) & attach to employees assignments by opening all old pay periods (Payroll>Description) from jan 11 to aug 11. now when i run payroll the run result cannot match our hard copies payslip tht ws run in jan 11.(before change of organization structure)
    i am new dont know if the above way is rite or wrong?
    i confuse ...not kno what is cause?
    plz help urgently!
    Edited by: 890115 on Oct 21, 2011 3:44 AM

    You will have to explain the steps properly -
    What is it that you want to achieve ?
    What is it that you have done, so far ?
    Unless others in the forum understand what you want to convey, it is really difficult to expect responses.
    So, help others to help you :)
    cheers,
    VB

  • BADI n-step SC approval - Approval Index and Data Change Problems

    Dear forum gurus,
    We are implementing SRM 5.0 (SRM SERVER 5.5 SP 9) in Extended classic. I am developing the BADI's to use the n-step SC approval workflow WS14000133.
    Our approval process is as follows:
    1. Cost Centre approver (based on CC with the largest value in the SC)
    2. Financial approver (based on the total value of the SC)
    I have done this now and it works as long as every step is approved!
    I have implemented the BADI 'BBP_WFL_EMPL_WI_BADI' - method 'CHECK_REQUESTER_WI' to send back any changes to the cost centre to the shopper to review. The standard also sends back total value changes to the shopper in the same way.
    My problem is that if the main CC or the total value of the SC are changed, the logic goes back to the shopper and then if the shopper 'Accepts changes', the logic skips the first apporver again and goes directly to the second (financial approver).
    I think there are 2 options:
    1. After the shopper accepts chnages, to restart the WF so a new WF template is generated. Then my logic will show the new CC and FI approvers again.
    2. I change my logic in the 'GET_REMAING_APPROVERS' method so the apporval index is not assumed to be 1 or 2 only. I guess I will have to work with logic to read the history and apporval index, but this seems very complex.
    Option 1 - I can't get this to work. After the shopper accepts changes I can't get the WF to restart in the 'BBP_WFL_SECUR_BADI'.
    Has anyone fixed this?
    Option 2 - The logic for checking apporval index and apporval history tables seems to me very complex. Has anyone done this and can they explain the logic to me if so? The problem here is that the sample code for this BADI assumes the approval indexis always 1 for the first step and 2 for the second step, but this is not the case!
    Thanks in advance,
    Best regards,
    Nick

    Hi,
    I feel setting the parameter BBP_WFL_SECURITY  for the Approver should do the trick.i.e. Restart the workflow adn the same approval process should be followed again.So plese adjust the value of this parameter for the Approver role in trascn PFCG.Also if you want to overwrite the settings of this paramtere(as maintained in PFCG),you can implement the BADI "BBP_WFL_SECUR_BADI".
    For  more info,refer  the foll links:
    http://help.sap.com/saphelp_srm50/helpdata/en/37/830b3b7e7ef74de10000000a114084/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/f7/a6a3415e34b05fe10000000a1550b0/frameset.htm
    BR,
    Disha.
    <b>Pls reward points for useful answers.</b>

  • Documents "Modifed Date" changes just by opening?

    We're seeing that Word, Excel & various other doc's change their "Date Modified" to today's date where they are ONLY opened...not modified.
    All we're doing is opening and closing, no changes....
    Is this a Micro$oft issue or can I change a preference somewhere??
    many thanks

    After seeing that the date-change problem seems to happen when you look at a document to which you have group access, but you aren't the owner of it, I just tried marking a similar document "read-only" using the Workgroup manager, then I went back to my desktop machine, opened it in Word, closed it again, responded 'no' to the dialog question about saving, and this time the date didn't change - and there was no MS Word error message..
    I'm haven't tested what happens if you try to do the same in finder from a client machine -- of course, usng Work Group manager that way is not really a practical solution.
    Also I'm going to see if the problem happens with a non MS Office application.

  • HT1296 I have a problem synching calendar data between my iPhone 3GS iOS 5.1 & Outlook 2007 on MS7.  The basic calendar is OK but the birthdays (little box icon) are a day early & cannot be changed to the correct date. How can I fix this?

    I have a problem synching calendar data between my iPhone 3GS iOS 5.1 & Outlook 2007 on MS7.  The basic calendar data transfer is OK but the birthdays (little box icon) are a day early & cannot be changed to the correct date. The birthday entries in my Outlook contacts have correct dates.How can I fix this?

    The following peocess corrects the calendar entry:
    edit the contact & change the birthday, save the change; edit the contact & change the birthday to the correct value, save the change again. The calendar entry then displays on the correct date.  Alternatively as a temp solution I can just de-select the "birthdays" calendar which stops the icon being displayed.
    Thanks for your advice, I think that it's n going to be a slow process to fix all the entries for not much return.

  • Calendar object changing date object when setTime(Date) is called

    long tt = System.currentTimeMillis();
              Date d=new Date(tt);
              if (getUsePickedDate())
                   d.setDate( getDay() );
                   d.setMonth( getMonth() );
                   d.setYear( getYear() );
              if (calendar==null)
                   calendar = new GregorianCalendar();
              calendar.setTime(d);when I use d.setYear( getYear() ); where getYear returns 2010, rather than when getUsePickedDate == false the calendar.setTime(Date) changes the Date d object, specifically changing "cashedYear" to 3910 from 2010, I checked with the debugger, its 2010 going into this function and 3910 coming out...
    the setYear() methods are depreciated for Date - but how am I supposed to use it? It seems they depreciated all the methods in Date...
    Could anyone suggest an alternative way of going about the above?
    Thanks
    Joe
    -edit 1 also, am i being stupid but where on earth are the code tags in this new forum??
    -edit 2 found the post on them - really should put it on the panel at the side, (i was using  before stupid me!)
    Edited by: 794057 on 21-Oct-2010 05:55
    Edited by: 794057 on 21-Oct-2010 06:01

    Do also note that the javadoc for Date.setYear says:
    "Sets the year of this Date object to be the specified value plus 1900."

  • Calendar object issues ... recompute remaining fields after change?

    Hello all. I'm doing date manipulation and arithmetic, but I'm running into a problem.
    I'm taking a date provided by a user and comparing it the current date. However, it's the month-end that I'm interested in.
    I'm already creating GregorianCalendar objects from each one, and doing the set on the DAY_OF_MONTH field to the value from getActualMaximum(DAY_OF_MONTH).
    The problem I'm having is that when dealing two dates from the same month, the two Calendar objects are >NOT< returning as EQUAL. After converting each object to a Date and running compareTo() (Side Bar: Why isn't compareTo() available in the Calendar class?) I'm not getting zero.
    I tried a toString() on the two objects, and I can see that some of the fields are not exact ... the time field is "?", WEEK_OF_YEAR, WEEK_OF_MONTH are different, etc. I can see the protected method complete() in the API, but attempts to execute them (gcCurrDate.complete()) yield compile errors stating the method is not visible.
    So how does one ask the system to fill in the remaining fields?
    Thanks!
    Steve

    According to the API docs for Calendar:
    "set(f, value) changes field f to value. In addition, it sets an internal member variable to indicate that field f has been changed. Although field f is changed immediately, the calendar's milliseconds is not recomputed until the next call to get(), getTime(), or getTimeInMillis() is made."

  • Is anyone else having problems with an iPhone 6 delivery date changing on them?

    I sat up until 12:01am to pre order (2) iPhone 6's and (2) iPhone 6 +'s and they had a delivery date of 9/19 for both of the phones at the time I logged on to Verizon's preorder site. The system would not allow me to log in as an existing customer but it would allow me to order as a new customer. I kept trying to order new phones as an existing customer on two different computers and three different browsers without any luck. I finally decided to order them as a new customer and the order went right through the Verizon system without any problem. Two minutes later I received an email from Verizon requesting that I call them as soon as possible to complete the order. I called in and spoke to a rep that explained that I already was an existing customer and that I would need to use the "Existing Customer" preorder link. I explained the issues I was having and she said that I would still need to use that system when it was available. So I tried the existing customer link and it now let me through but the date for the iPhone 6 plus had slipped to 10/7 (It is now 1:30 am). I completed the transaction and it stated 9/19 delivery for iPhone 6 and 10/7 for the iPhone Plus. However once I received the email confirmation it stated that the delivery date for the phones was 10/7. I called Verizon customer service and stated my concern about the later delivery date for the iPhone 6 and they told me that the iPhone 6's would arrive on the 19th and the pluses would arrive on 10/7 so I did not change my order. This morning 9/19 8:00am I called in to inquire about my shipping confirmation numbers for the (2) iPhone 6's and the customer service rep (Robanya) told me that he would call me back at 1:00pm PST and give me the shipping confirmation numbers. He asked specifically which phone number he should call me back on and I gave him my cell number. After not receiving a call back from Robanya, I called Verizon customer service at 5:30pm and spoke Ryan James and he confirmed that the orders were placed on the 12th of Sept and that one system showed all of them due to be delivered 10/7. After insisting that Robanya that I spoke with earlier in the day said they were shipping today, Ryan got off the phone for 5-10 mins and then got back on and said that the iPhone 6's shipped yesterday on the 18th but he did not have a confirmation number. After pressing him that someone should have this confirmation number in Verizon he stated that the delivery dates were subject to change and that all the phones would probably ship on 10/7 and left it at that.
    So after loosing sleep to pre order phones on Verizon, speaking with (3) different Verizon reps, I am rewarded by having my delivery date changed to 10/7 on my iPhone 6's which is the same delivery date they were quoting yesterday 9/18.
    Did any one else have the same disappointing experience that I had?

    Yes, pre-ordered iPhone 6 with a guaranteed delivery date of 19 September; took screen shots after the order just to have record of it.
    Called Verizon 18 Sept because I hadn't received a tracking number yet, and was informed my phone would now ship 7 October.  When I expressed that was different than what was promised and had proof, a manager came on the phone and confirmed that I should have a 19 Sept delivery date based on their records.  She told me however she could not confirm when my order would ship.
    19 Sept came and went with no phone delivery.  I have tried calling Verizon, posting here, and posting on their FB page for customer service.  Every rep I talked to (except for the first manager on 18 Sept) has been unable to admit that they mislabeled their product sales page, and mislead the customer.  One rep told me the guaranteed delivery date was an "estimate"; when I asked her to show me on the website where it uses the term "estimate", she admitted it didn't communicate that, but still was unable to utter the words "we made a mistake".
    VZW needs to take a 101 class in customer service and crises management; rule #1 is if you screw up, admit it!  I know I am not going to get my iPhone as promised, but pretending like there is nothing wrong with that customer service experience is just making things worse. Not a single employee I have communicated with to date has attempted to do anything proactive to correct or mitigate the customer failure.  I am truly amazed at how poorly VZW has been handling this to date; again (removed) happens with supply/demand, website errors, etc, but the failure to acknowledge how the screw up shafted a lot of (formally) loyal long time customers is criminal.
    >> Edited to comply with the Verizon Wireless Terms of Service <<
    Edited by:  Verizon Moderator

Maybe you are looking for

  • Pavillion dv5-1002nr with 32-bit Vista

    Using HP Recovery Disks, the notebook prematurely shuts down. The recovery was started due to stability problems resulting in Vista not loading. During some of the running of the Recovery Manager, the error message has occurred: STOP:c000021a {Fatal

  • Expected expression error in X code.

    Hi i am a newbie to app developing and the objective c language but i  have exhausted all my efforts in trying to find out whats causing this  error my code is as follows: -(IBAction)back:(id)sender {     if ([webView canGoBack] == YES)     {[webView

  • JSF + SEAM

    hi all, I am new to this blog. i am here because i have recently joined a company and was told that training will be given to me on SEAM and JSF.. I am a complete fresher and have only heard about struts and hibernate framework , dont know much about

  • Similar Wi Fi woes but a little different.

    I don't have a physical router (I'm using the built in Airport on my iMac) but can't connect to anything over my iPhone G3's (or my first gen iPhone) Wi Fi. I have Airport turned on on my iMac and it says it's connected to Apple Network ##### and has

  • My apple id have bean stolen

    SOme one hacked my id and change all my info i cant get mail from apple to rewrite new pass