简体   繁体   中英

Spring Scheduling - Cron expression for every month end at 11PM?

I would like to run cron expression at 11:10 pm of very month ending. I am trying to write by following link A Guide To Cron Expressions but I am unable to write. Sample code is below is this will work fine.

@Scheduled(cron = "0 10 23 L * ? *")
public void scheduleTaskWithCronExpression() {
    System.out.println("Cron Task");
}

Try with this:

@Scheduled(cron = "0 10 23 L * ?")

For generate or check corn expression use this

You can also try with time zone

@Scheduled(cron = "0 10 23 L * ?", zone = "CET")
public void scheduleTaskWithCronExpression() {
    System.out.println("Cron Task");
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM