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

  • SEARCH
  • Home
  • 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 6131421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:58:22+00:00 2026-05-23T16:58:22+00:00

I have a Date object. Now I want to add days to that Date

  • 0

I have a Date object. Now I want to add days to that Date object.
So how that can be done? Actually using Calendar object that can be done I know.
But in my case, I haven’t used a calendar objects. Instead only used date object.

For Example, suppose I have a date object

Date dtStartDate=o.getStartDate();

int x=28;

Now what I want to do is to add 28 to this date object, means if the dtStartDate is 1 July 2011
then after adding 28, dtStartDate will be 29 July 2011.
Please suggest it to me.

Thanks in advance

  • 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-23T16:58:23+00:00Added an answer on May 23, 2026 at 4:58 pm

    You can add Day using below

    Calendar c1 = Calendar.getInstance();
    c1.add(Calendar.DAY_OF_MONTH, 1);
    

    Here 1 is number of Day you can add.

    OR

    Date dtStartDate=o.getStartDate();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
    Calendar c = Calendar.getInstance();
    c.setTime(dtStartDate);
    c.add(Calendar.DATE, 3);  // number of days to add
    String dt = sdf.format(c.getTime());  // dt is now the new date
    Toast.makeText(this, "" + dt, 5000).show();
    

    May be your problem solved.

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

Sidebar

Related Questions

I have date in sting object in following format. dd/mm/yyyy I want to change
I have a current Date object that needs to be incremented by one day
I have been trying to add to the Watch window a Java Date object
I want to create a date object, and have the time saved as I
So I have a Date object and I want to create a method so
So now, its 9:23am. I have a UTC date string that represents the current
I have two Zend Date objects to work with: $now = Zend_Date::now(); $sessionStart =
I have a Javascript Date object equal to 00:30 and when doing: date.setMinutes(date.getMinutes() +
How to sort list of date object ? For example I have unsorted list
Let's say I have an object: public class CustomObj { DateTime Date { get;

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.