Getting Week days
<p>I created a program that is running daily at a certain time,</p>

<p>but I want this program to stop at some particular days(week ends),</p>

<p>I have used the below codes to set the current time,</p>

<pre><code>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;
 }    
</code></pre>

<p>and the below code in the main class</p>

<pre><code>while(true)
 {
      Thread.sleep(1*1000);
       if(gt.GetDateNow()==0000)
       {
       //perform action
      }
 }
</code></pre>
