Skip to content

Instantly share code, notes, and snippets.

@corneliouzbett
Created April 17, 2019 22:19
Show Gist options
  • Save corneliouzbett/fca421ecde050175ddde04ecffd8f041 to your computer and use it in GitHub Desktop.
Save corneliouzbett/fca421ecde050175ddde04ecffd8f041 to your computer and use it in GitHub Desktop.
public void cronJobSch() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
Date now = new Date();
String strDate = sdf.format(now);
System.out.println("Java cron job expression:: " + strDate);
}
@corneliouzbett
Copy link
Author

The following is a sample code that shows how to execute the task every minute starting at 9:00 AM and ending at 9:59 AM, every day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment