File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
difference in days
Joined: Jan 29, 2010
Jun 08, 2010 04:57:51
How do I calculate the number of days left of a future date from the current date?
Joined: Jul 29, 2008
Jun 08, 2010 05:02:58
futureDay.getTime() - today.getTime()
returns the number of milliseconds between today and the 'future'.
Do some maths to get the number of days from it.
Author of ExamLab
- a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like?
How to Ask a Question
Joined: Oct 27, 2005
Jun 08, 2010 05:19:34
Except that doesn't work with Daylight Savings Time.
Search this forum, this question has been asked and answered (among others by me) several times before.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
I agree. Here's the link:
subject: difference in days
dates in java
HQL 2 – how to say “within X days from today”?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015