This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Hi Why don't you handle this in your query itself? Sysdate will give you current date and time, and the date of joining that would have been stored in the table can be subtracted. If its stored as Varchar(instead of date) use the inbuilt to_date function. This, alongwith a bit of googling will get you through.
If I become filthy rich, I'll sponsor research for painless dental treatment at Harvard Medical School. Thats why,I'm learning Java.I have 32 teeth, 22 are man made.
There is one problem with that code: it is defective because of daylight savings time. Because of that, days can have 23 or 25 hours as well.
Using Calendar.get(Calendar.DAY_OF_YEAR) and Calendar.get(Calendar.YEAR), combined with Calendar.getActualMaximum(Calendar.DAY_OF_YEAR), you can calculate the result more precisely. Search on this forum, I've answered this question at least 3 times already.