Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Year help

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Year help

    I'm not really sure where to post this so I will do it here.
    I want to make a counter for days, months and years. The days and months will not be very hard, but the problem is years. As everyone knows every 4 years there is one more day in the year. How would I make this in the counter? I want it to be able to run from the year 1.000 until the year 25.000 (in other words every possible year) and every 4 years have a day extra.
    How would I be able to let the counter require 1 more day every 4 years?
    I think that I will need some math formula for it. (Is formula the right word?)


  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Year help

    Is there a reason why you're not using GregorianCalendar?

    GregorianCalendar (Java 2 Platform SE 5.0)

  3. The Following User Says Thank You to Sean4u For This Useful Post:

    wuppy29 (June 25th, 2012)

  4. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Year help

    I didn't know it existed. Thanks

Similar Threads

  1. What can be accomplished in a year?
    By OA-OD-JD1 in forum Member Introductions
    Replies: 6
    Last Post: January 24th, 2012, 03:28 AM
  2. Codeacademy + Code Year
    By KevinWorkman in forum The Cafe
    Replies: 19
    Last Post: January 15th, 2012, 11:09 PM
  3. return a day of the year
    By lipry in forum Java Theory & Questions
    Replies: 3
    Last Post: January 23rd, 2011, 05:10 PM
  4. Leap year program
    By cyspope in forum What's Wrong With My Code?
    Replies: 4
    Last Post: September 22nd, 2010, 10:20 PM
  5. Day,Month,Year Concatenation Error
    By srinivasan_253642 in forum JDBC & Databases
    Replies: 1
    Last Post: January 22nd, 2010, 04:40 AM