use date.getTime() for both the dates.
subtract them and divide the difference by (1000*24*60*60) which is the no.
of milliseconds in a day.
this will give u the exact no. of days betn two dates.
if the no is greater than zero the date is after else before.
if the no. is == 1 then its exactly 24 hrs after. the static variable.
hope this will help.
Regards,
Kaustubh.
----- Original Message -----
From: "Asif.Raj" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 23, 2002 11:03 AM
Subject: Re: Calendar object


> you can subtract one day from the current calendar object using the add()
> method and then use the after() method to check whether it comes after or
> before your static variable.
>
> Asif
>
> > -----Original Message-----
> > From: Liam Redmond [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, July 23, 2002 1:37 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Calendar object
> >
> >
> > I use the "before" and "after" methods for a comparing time stamps.
> >
> > -ldr
> >
> > ----- Original Message -----
> > From: "Falls, Travis D (CASD, IT)" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, July 22, 2002 8:50 PM
> > Subject: Calendar object
> >
> >
> > > Hello,
> > > I want to figure out if the current date/time is 24 hours
> > or longer from a
> > > static Calendar Var that I have stored.  Is there a way to
> > subtract the
> > two
> > > objects?  Or do I have to do all the calculations.
> > >
> > >
> > > Regards,
> > >
> > > Travis D. Falls
> > > SR. Software Engineer
> > > The Hartford (CASD)
> > > 860.547.4070
> > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > > http://www.thehartford.com
> > >
> > >
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to