I created a program that is running daily at a certain time,
but I want this program to stop at some particular days(week ends),
I have used the below codes to set the current time,
public int GetDateNow()
{
Calendar currentdate = Calendar.getInstance();
DateFormat dateformat = new SimpleDateFormat("HHmm");
String datenow = dateformat.format(currentdate.getTime());
int DN=Integer.parseInt(datenow);
return DN;
}
and the below code in the main class
while(true)
{
Thread.sleep(1*1000);
if(gt.GetDateNow()==0000)
{
//perform action
}
}