Article View: borland.public.jbuilder.java.language
Article #17386Re: Date Comparison
From: Ross M. Dukeshier
Date: Mon, 16 Nov 1998 00:00
Date: Mon, 16 Nov 1998 00:00
23 lines
1329 bytes
1329 bytes
Joe Hrubovcak wrote: > > How can I effectively compare dates? I'd like to get 2 strings from a > text box, convert them to dates and ask if date1<date2. Check out the Calendar class. If I remember right, despite its name, this relates to Date/Times. There are after/before methods that will tell you if the Date (Calendar object) whose method you call is after/before the Date (Calendar object) you pass to it. Example. c1 and c2 are Calendar objects c1.after(c2) will return true if c1 is after c2 c1.before(c2) will return true if c1 is before c2 yada yada yada. There should be methods to set the objects either via String or a Date object (I think this was deprecated somewhere along the way to make it internationalized). Ross Dukeshier
Technical Details
Message-ID:
<3650CD2F.411E@flash.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3650C82F.2ABB94BA@lancomp.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,ea64d894a8ad4df9 X-Google-Attributes: gidf74b3,public From: "Ross M. Dukeshier" <dukeman@flash.net> Subject: Re: Date Comparison Date: 1998/11/16 Message-ID: <3650CD2F.411E@flash.net> X-Deja-AN: 412612469 Content-Transfer-Encoding: 7bit References: <3650C82F.2ABB94BA@lancomp.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Reply-To: dukeman@pop.flash.net Newsgroups: borland.public.jbuilder.java.language