How can one day be added to a date?

0 votes

I want to add one day to a particular date. How can I do that?any help?

Jun 8, 2018 in Java by Akrati
• 3,170 points
94 views

1 answer to this question.

0 votes

One possible solution could be using calendar class:

Date dt = new Date();
Calendar cal = Calendar.getInstance(); 
cal.setTime(dt); 
cal.add(Calendar.DATE, 1);
dt = cal.getTime();
answered Jun 8, 2018 by Daisy
• 8,110 points

Related Questions In Java

0 votes
0 answers

How to manage two JRadioButtons in java so that only one of them can be selected at a time?

How to manage two JRadioButtons in java ...READ MORE

Apr 21 in Java by kartik
• 37,070 points
184 views
0 votes
1 answer

Can quotes be added in a java string.how?

In Java, you can escape quotes with \: String ...READ MORE

answered Jun 14, 2018 in Java by Akrati
• 960 points
79 views
0 votes
2 answers

How can I convert a String variable to a primitive int in Java

 Here are two ways illustrating this: Integer x ...READ MORE

answered Aug 20, 2019 in Java by Sirajul
• 58,210 points
563 views
0 votes
1 answer

How can a war file be deployed in Tomcat 7?

You can access your application from: http://localhost:8080/sample Deploying ...READ MORE

answered Apr 20, 2018 in Java by sophia
• 1,400 points
1,146 views
0 votes
4 answers

How can we compare dates in java?

public static String daysBetween(String day1, String day2) ...READ MORE

answered Sep 5, 2018 in Java by Sushmita
• 6,890 points
161 views
0 votes
1 answer

How can I calculate number of days between two dates?

You may refer this. This might work ...READ MORE

answered Jul 19, 2018 in Java by Akrati
• 3,170 points
547 views
0 votes
1 answer

How to calculate the interval between 2 dates

The following code might be helpful: public static ...READ MORE

answered Aug 29, 2018 in Java by bug_seeker
• 15,510 points
137 views
0 votes
1 answer

Get the Current time in Python

To get the current date and time ...READ MORE

answered Oct 3, 2018 in Python by SDeb
• 13,250 points
114 views
0 votes
2 answers

How can we add an image to a JPanel?

If you are using JPanels, then are ...READ MORE

answered Sep 20, 2018 in Java by Daisy
• 8,110 points
5,171 views
0 votes
1 answer

How to determine day of week by passing specific date?

You can use java.util.Calendar: Calendar c = Calendar.getInstance(); c.setTime(yourDate); int dayOfWeek ...READ MORE

answered Oct 30, 2018 in Java by Daisy
• 8,110 points
2,375 views