J
jamie.patricks
Hi,
I would like to get last Friday's date. Can you please check if there
is any issue with the code below? Thanks.
GregorianCalendar calendar = new GregorianCalendar();
// set to last week
calendar.set( Calendar.WEEK_OF_YEAR ,
calendar.get(Calendar.WEEK_OF_YEAR)-1 );
// set to Friday
calendar.set( Calendar.DAY_OF_WEEK, Calendar.FRIDAY );
Regards,
Jamie
I would like to get last Friday's date. Can you please check if there
is any issue with the code below? Thanks.
GregorianCalendar calendar = new GregorianCalendar();
// set to last week
calendar.set( Calendar.WEEK_OF_YEAR ,
calendar.get(Calendar.WEEK_OF_YEAR)-1 );
// set to Friday
calendar.set( Calendar.DAY_OF_WEEK, Calendar.FRIDAY );
Regards,
Jamie