hleungta
asked on
Java - Date
How do I get the day of the week for a given date ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm using 1.1 therefore don't want to use deprecated functions.
I'm not sure I completely undertand the use of Calendat.get(...)
Maybe I'm going re-explain my problem:
I have a Date object and want to get the DAY OF WEEK
. how do I use the Calendar class to get this day of week ?
I'm not sure I completely undertand the use of Calendat.get(...)
Maybe I'm going re-explain my problem:
I have a Date object and want to get the DAY OF WEEK
. how do I use the Calendar class to get this day of week ?
A calendar is created and initialized as follows:
//create a Gregorian Calendar
Calendar calendar = new GregorianCalendar();
//set calendar time with a Date object
calendar.setTime(now);
//get day of the week
int i=calendar.get(Calendar.DA Y_OF_WEEK) ;
//create a Gregorian Calendar
Calendar calendar = new GregorianCalendar();
//set calendar time with a Date object
calendar.setTime(now);
//get day of the week
int i=calendar.get(Calendar.DA
ASKER