Re: Month difference between dates
- From: dagon@xxxxxxxxx (Mark Rafn)
- Date: Fri, 30 Mar 2007 14:09:59 -0700
zamba <CRISTIAN_FERRERO@xxxxxxxxxxx> wrote:
Hi i want to know if there is a way to know exactly the number of
months (instead o days) between to diferent dates..
I sometimes ask this as an interview question, and the only good answer is
to ask me questions about what exactly I want. I'll do the same: please
specify what you mean by "number of months between two dates".
How many months are between Jan 1 and Jan 2? Jan 1 and Jan 30? Jan 1 2007
and Dec 31 2006? Feb 1 and 28 days afterward in 2007? in 2008?
For most reasonable definitions, the java.util.Calendar class will get you the
information you need to calculate the answer.
--
Mark Rafn dagon@xxxxxxxxx <http://www.dagon.net/>
.
- Prev by Date: Re: problems with Java
- Next by Date: Re: Month difference between dates
- Previous by thread: What sort of documentation is most useful for a java application?
- Next by thread: Re: Month difference between dates
- Index(es):