Possible Duplicate:
How to calculate the difference between two Java java.sql.Timestamps?
How do you calculate how many years/months/days (don't really need time) between two timestamps that you've acquired from an SQL in Java?
Below is a snippet of a code I'm using:
query = "SELECT bc.periodbeginningdate " +
"FROM cus_billingcontract bc " +
"WHERE cus_billingcontract_id = " + recordID;
Timestamp bDate = DB.getSQLValueTS(null, query);
query = "SELECT bc.periodenddate " +
"FROM cus_billingcontract bc " +
"WHERE cus_billingcontract_id = " + recordID;
Timestamp eDate = DB.getSQLValueTS(null, query);