?
Solved

How to get the next day in Java?

Posted on 2010-08-27
2
Medium Priority
?
728 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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ā€¦
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to implement Singleton Design Pattern in Java.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

765 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