• Post Reply Bookmark Topic Watch Topic
  • New Topic

Require help regarding cron4j.scheduler  RSS feed

 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I dont know wheather its right forum to place this problem.

The problem is regarding cron4j.scheduler...
I am trying to schedule activity according to differrent timezones.
But the code is not working..
It doesnt give any error or exception but its not scheduling the task according to timezones.Its performing task according to my system's timezone.
Please help me out of this problem.
My code is as follows,


import it.sauronsoftware.cron4j.Scheduler;
import java.util.TimeZone;
public class SchedulerTimeZoneTest {
public static void main(String[] args) {
System.out.println("trying to schedule activity");
Scheduler scheduler=new Scheduler();
TimeZone timeZone1=TimeZone.getTimeZone("GMT+06:00");
scheduler.setTimeZone(timeZone1);
scheduler.schedule("* 15 * * *", new MyTimeZone());
scheduler.start();
System.out.println("activity scheduled ");
}

}

import java.util.Date;

public class MyTimeZone implements Runnable{

public void run() {
// TODO Auto-generated method stub
System.out.println("In MyTimeZone at :"+new Date());
}


}
 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please somebody reply..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!