title: How to set Server Time for ScheduledTimerTask in spring?
body: <p>We are using ScheduledTimerTask to manage the jobs(automatic) in our application.We are using the following code:</p>
  
  <pre><code>&lt;bean id="SampleTask" 
    class="org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean"&gt;
      &lt;property name="targetObject" ref="sampleScheduler" /&gt;
      &lt;property name="targetMethod" value="runMethod" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="sampleScheduler" class="com.sample.SampleScheduler" /&gt;
  
  &lt;bean id="timerTask"
      class="org.springframework.scheduling.timer.ScheduledTimerTask"&gt;
      &lt;property name="timerTask" ref="schedulerTask" /&gt;
      &lt;property name="delay" value="1000" /&gt;
      &lt;property name="period" value="60000" /&gt;
  &lt;/bean&gt;
  
  &lt;bean class="org.springframework.scheduling.timer.TimerFactoryBean"&gt;
      &lt;property name="scheduledTimerTasks"&gt;
          &lt;list&gt;
              &lt;ref local="timerTask" /&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>By using the above code <code>runMethod</code> is working fine for every one minute.But we would like to change the execution based on server time.For example,If time in server is 6 PM then we need to invoke the function.How to achieve it?</p>
  
  <p>Help would be appreciated.</p>