Article View: borland.public.jbuilder.java.language
Article #19063Re: Finding weekday for a certain date
From: Chris Fowlkes
Date: Wed, 18 Mar 1998 00:00
Date: Wed, 18 Mar 1998 00:00
47 lines
1687 bytes
1687 bytes
I tried using the GregorianCalendar and got the same result. Do you have a working example? Chris Conrad Hoesle-Kienzlen wrote: > 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 > > > > ****************************************** -- ****************************************** Email address: chris@bitwiseinc.com ******************************************
Technical Details
Message-ID:
<350FD8D6.919B81FF@bitwiseinc.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<350EDE4B.712BFEC0@bitwiseinc.com> <350F0693.4464AFE2@csi.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: Chris Fowlkes <chris@bitwiseinc.com> Subject: Re: Finding weekday for a certain date Date: 1998/03/18 Message-ID: <350FD8D6.919B81FF@bitwiseinc.com> X-Deja-AN: 335248125 Content-Transfer-Encoding: 7bit References: <350EDE4B.712BFEC0@bitwiseinc.com> <350F0693.4464AFE2@csi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language