Article View: borland.public.jbuilder.java.language
Article #17577Re: Date calculations
From: Aaron Gaalswyk
Date: Tue, 20 Oct 1998 00:00
Date: Tue, 20 Oct 1998 00:00
19 lines
975 bytes
975 bytes
import java.util.*;
public int difference(Date earlier, Date later)
{
// difference in milliseconds
long diff = later.getTime() - ealier.getTime();
// difference in days (86400000 ms / day)
return (int)(diff / 86400000);
}
Aaron Gaalswyk
prears wrote in message <362BB8AE.F8BFD474@lancomp.com>...
>Does anyone have a code snipped for finding the difference between two
>dates (value returned should be an integer for the number of days)
>
>Thanks in advance
>
Technical Details
Message-ID:
<70jp5n$gbs4@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<362BB8AE.F8BFD474@lancomp.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,26cb49c9cbd4282b X-Google-Attributes: gidf74b3,public From: "Aaron Gaalswyk" <gaalswyk@spacestar.net> Subject: Re: Date calculations Date: 1998/10/20 Message-ID: <70jp5n$gbs4@forums.borland.com> X-Deja-AN: 403434847 References: <362BB8AE.F8BFD474@lancomp.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language