[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to get the next day in Java?

Posted on 2010-08-27
2
Medium Priority
?
733 Views
Last Modified: 2013-12-14
Hi I'm working with dates in Java in format of ddmmyyyy and mmddyyyy. Currently I'm working with strings only and I wany to use Java objects instead. I need these features from the object:

1. I need the ability to get a string represantaion of the Object as dd/mm/yyyy or mm/dd/yyyy.
2. I need to be able to get the next day in  the calendar (the input should be such a Java object)
3. Is this object Comparable? i.e Can I insert it to a tree map and it will be sorted accordingly?

What object should I use and how?

Thanks!
0
Comment
Question by:HPBSM
2 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 33543093
1. Use a DateFormat
2. Use Calendar.add
3. Yes, Date is Comparable - you'd use that. It's the *keys* of a tree map that are sorted
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 33546122
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
Suggested Courses
Course of the Month19 days, 5 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question