Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3615466
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:22:37+00:00 2026-05-18T22:22:37+00:00

i hav String date & i want to inceament date by 1 & it

  • 0

i hav String date & i want to inceament date by 1 & it should be loop until end of the month.
as examle, if i take November 2010 it should loop 30 days.
if i take December 2010 it should loop 31 days.
below shows my code……

String date="12/01/2010";
String incDate;
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
Calendar c = Calendar.getInstance();
c.setTime(sdf.parse(date));
for(int co=0; co<30; co++){
    c.add(Calendar.DATE, 1); 
    incDate = sdf.format(c.getTime());
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:22:38+00:00Added an answer on May 18, 2026 at 10:22 pm
    String date="12/01/2010";
    String incDate;
    SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
    Calendar c = Calendar.getInstance();
    c.setTime(sdf.parse(date));
    int maxDay = c.getActualMaximum(Calendar.DAY_OF_MONTH);
    for(int co=0; co<maxDay; co++){
        c.add(Calendar.DATE, 1); 
        incDate = sdf.format(c.getTime());
    }
    

    The c.getActualMaximum(Calendar.DAY_OF_MONTH) result will be the last day of the month.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hav a string e.g. 2010-09-24 . Now I want this string read as
i hav a html tags stored in string and i want to load the
i have a string strored in str variable i want to find string length
i hav removed items from tool bar,but i want to re add it at
i hav a file with some data and i want to attach this file
how to convert a string (wstring) from lowercase to uppercase characters and vice versa?
i have coded a socket listener that should listen on port 80 and 81
I hav codes eg1.py , eg2.py , eg3.py eg3.py imports eg2.py which in turn
i hav created a COM component using vs2005 . Now let me know can
i hav xcode 3.2.2 and when i was downloaded new version and dragged it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.