This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Date and Time manipulation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Date and Time manipulation" Watch "Date and Time manipulation" New topic
Author

Date and Time manipulation

mallikarjuna ch
Greenhorn

Joined: May 28, 2009
Posts: 5

Hi,

For our applicatio i have to develop one which has to show remaining time from today. To reach this kind of requirement ,
I am calculating the end date from give data. and I am calculating seconds difference and again making that into days and hours,
To implement this functionality coding part is becoming more .

So please tell me is there any readymade jar file to handle the date and time functionality. Also send me a sample for that.

regards,
Mallikarjuna
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Please read your private messages.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12928
    
    3

The standard date and time API in Java is unfortunately not so good at many things. One popular library for handling dates and times is Joda Time - there's even a JSR with a proposal for a new date and time API for a future version of Java, which will most likely be based on Joda Time.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
mallikarjuna ch
Greenhorn

Joined: May 28, 2009
Posts: 5
Thank you for your response.

I am using that joda time jar file only. with that also I have some issues.
I have one start date, from that time , I have to increase the date by adding weeks and days , but This joba providing onlyimmutable objects , it is not recomadable for the iterations

if you knows any another please tell me..


thanks
mallikarjuna
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35250
    
    7
mallikarjuna ch wrote:This joba providing onlyimmutable objects , it is not recomadable for the iterations

What does the (im)mutability of an object have to do with its capabilities? Looking at the javadocs of org.joda.time.DateTime, I see numerous methods that add or subtract various time quantities (and return it as a new object). That should cover your needs nicely.


Android appsImageJ pluginsJava web charts
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Mallikarjuna, I urge you to read that private message I sent you, and follow my instructions.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date and Time manipulation
 
Similar Threads
Too many files open
How to determine session time difference?
Business days calculation
Time format in Java
LeapCentury--Date fun. fails to identify?