Results 1 to 4 of 4
  1. #1
    sbekele is offline Member
    Join Date
    Jan 2010
    Posts
    2
    Rep Power
    0

    Default Getting the next saturday or sunday from a given date

    I am trying to get the next saturday from a given date. Forexample, if I have given the date 01/27/2010 then I want to get the next saturday which is 01/30/2010. Is this possible in Java?

    Thanks

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Yes. Have a look at the Calendar API.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    sbekele is offline Member
    Join Date
    Jan 2010
    Posts
    2
    Rep Power
    0

    Default

    Can you give me some idea how can I use the calendar API.

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,454
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by sbekele View Post
    Can you give me some idea how can I use the calendar API.
    1 Create a calendar given a date.
    2 check what day it is.
    3 if it is one of the days you want stop.
    4 'roll' the day to the next day
    5 goto step 2.

    kind regards,

    Jos

Similar Threads

  1. julian date to full date format
    By judy318 in forum New To Java
    Replies: 7
    Last Post: 11-02-2009, 12:17 PM
  2. Compare date input to database with current date
    By hungleon88 in forum Advanced Java
    Replies: 2
    Last Post: 11-25-2008, 08:10 AM
  3. Tech Career Fair - eHarmony - Saturday - Sept 27th
    By Volt Recruiter in forum Jobs Offered
    Replies: 0
    Last Post: 09-25-2008, 12:49 AM
  4. Creating a Gregorian Calendar using a Date object gives date - 1
    By prachi_goliwadekar in forum New To Java
    Replies: 1
    Last Post: 05-08-2008, 08:32 PM
  5. Difference between current date and anothe date
    By vijay balusamy in forum New To Java
    Replies: 1
    Last Post: 04-16-2008, 04:15 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
  •