Article View: borland.public.jbuilder.java.language
Article #19054Re: Finding weekday for a certain date
From: Conrad Hoesle-Kienzlen
Date: Wed, 18 Mar 1998 00:00
Date: Wed, 18 Mar 1998 00:00
30 lines
1300 bytes
1300 bytes
Chris, use "GregorianCalendar" instead. ...Conrad Chris Fowlkes wrote: > Is there a way to find what weekday a particular day falls on witout > using depricated methods? > > example... > > Calendar calendar = Calendar.getInstance(); > calendar.set(cYear, cMonth, 1); > int weekday = calendar.get(Calendar.DAY_OF_WEEK ); > > This should tell you what day a given month starts on, but weekday > ALWAYS ends up being zero. > > Date dteDate = new Date(cYear - 1900, cMonth, 1); > int weekday = dteDate.getDay(); > > This does work but is depricated. Is there another way? > > -- > ****************************************** > > Email address: chris@bitwiseinc.com > > ******************************************
Technical Details
Message-ID:
<350F0693.4464AFE2@csi.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<350EDE4B.712BFEC0@bitwiseinc.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,e41b6861640661da X-Google-Attributes: gidf74b3,public From: Conrad Hoesle-Kienzlen <Conrad_Hoesle@csi.com> Subject: Re: Finding weekday for a certain date Date: 1998/03/18 Message-ID: <350F0693.4464AFE2@csi.com> X-Deja-AN: 335051897 Content-Transfer-Encoding: 7bit References: <350EDE4B.712BFEC0@bitwiseinc.com> Content-Type: text/plain; charset=us-ascii Organization: CHK IT-Consulting Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language