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 6 of 6

Thread: numbered months

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    17
    My Mood
    Confused
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default numbered months

    hey all,

    does anyone know if there is some code which gets the current month in number form?
    not its name

    thanks


  2. #2
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: numbered months

    Use the Calendar get() method.

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

    JavaN00b101 (February 8th, 2012)

  4. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    17
    My Mood
    Confused
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Re: numbered months

    thanks for that

  5. #4
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: numbered months

    You're welcome.

  6. #5
    Junior Member
    Join Date
    Nov 2011
    Posts
    17
    My Mood
    Confused
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Re: numbered months

    do u know how i could use the number of the current month i get to subtract it from one the user inputs? i tried some things but i cant figure it out

  7. #6
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: numbered months

    You appear to be asking, in effect, how to subtract. I feel the problem may be something else.

    Post what you have tried. And describe what happened. If there is a compiler message you can't understand post the message and someone will help explain what it means.

    If what you tried does compile but when you run it, it does not give you the result of the subtraction then describe what it *does* as well as what you expected it would do.

Similar Threads

  1. Replies: 1
    Last Post: January 12th, 2012, 09:14 AM
  2. Replies: 0
    Last Post: January 12th, 2012, 07:00 AM