Results 1 to 5 of 5
  1. #1
    HEYBUDDY is offline Member
    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Default Calendar operation

    I have a date - example - 22-09-2012(start date) I have to find my end date based on the current quarter

    My input are month of the quarter which is a list box with values(1,2,3) , Day of the month in list box with values ( 1 to 31)

    If my current quarter is 1 (Jan to Mar) thenin my month list box 1 will be january, 2 will be feb and 3 will be march Similarly this will vary for each quarter

    Now I have selected my Month as 1, Since this quarter will be third quarter my month selected will correspond to september and my selected day of month is for example 6. Since 6 th is already past in month september, my Month selected from the month list box (that is 1) will correspond to the next quarter 1st month ( January)

    If suppose my selected day of month is 23, it falls tomorrow and is not yet over so my end date should be calculated as 23-09-2012

    How to find whether the day I have selected will be on the current quarter or in the next quarter

    Please help

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Calendar operation

    Your double post has been locked. Please read the forum faq and abide by our rules including no unnecessary duplicate posts. Thank you for your attention in this and your future compliance.

  3. #3
    HEYBUDDY is offline Member
    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Default Re: Calendar operation

    Quote Originally Posted by fubarable View Post
    your double post has been locked. Please read the forum faq and abide by our rules including no unnecessary duplicate posts. Thank you for your attention in this and your future compliance.
    what should i do now

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Calendar operation

    First figure out how you would go about solving this without a computer. Write down the steps for a particular data set, then rewrite the steps for a general case.

    Once you have that in a form that you could give to a primary school student and get the correct answer back from him, start writing Java code that mimics each step. Compile and test often so that you don't keep coding after you already have a mistake or bug in code already written.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Calendar operation

    Cross posted
    Calendar Operation

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Matrix Value operation
    By jaimitoc30 in forum New To Java
    Replies: 0
    Last Post: 04-09-2012, 06:15 PM
  2. Calendar now = Calendar.getInstance()
    By volkvanmyn25 in forum New To Java
    Replies: 3
    Last Post: 10-31-2011, 10:25 PM
  3. Replies: 4
    Last Post: 09-21-2011, 04:39 PM
  4. XOR operation on bytes
    By divyanshu023 in forum New To Java
    Replies: 1
    Last Post: 09-17-2009, 07:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •