| Author |
How to find difference between dates
|
Anupama Avadutha
Greenhorn
Joined: Mar 26, 2008
Posts: 3
|
|
hi all, This is my first post in Java Ranch.Please excuse me if my question seems to be too simple. I want to know how to find the difference between two dates in java.Somehow i did not understand java dates concept properly.Thank you in advance.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12907
|
|
anupama, please check your private messages. You can see them by clicking My Private Messages. There's nothing very difficult about dates in Java. If you have two Date objects, you can call getTime() on both the objects and subtract the values from each other - that will give you the difference between the dates in milliseconds.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Anupama Avadutha
Greenhorn
Joined: Mar 26, 2008
Posts: 3
|
|
|
thank you i will try this and approach you back if i have any doubt.
|
 |
Ramaswamy Srinivasan
Ranch Hand
Joined: Aug 31, 2004
Posts: 295
|
|
@Anupama, Readymade recepies are available. Though it would not be advisable to take them when you begin programming, once in a while you can do it! This article gives you all you are looking for!
|
 |
 |
|
|
subject: How to find difference between dates
|
|
|