🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19045

Finding weekday for a certain date

#19045
From: Chris Fowlkes
Date: Tue, 17 Mar 1998 00:00
24 lines
1154 bytes
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: <350EDE4B.712BFEC0@bitwiseinc.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,e41b6861640661da,start
X-Google-Attributes: gidf74b3,public
From: Chris Fowlkes <chris@bitwiseinc.com>
Subject: Finding weekday for a certain date
Date: 1998/03/17
Message-ID: <350EDE4B.712BFEC0@bitwiseinc.com>
X-Deja-AN: 334965204
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.language