java – Spring调度程序的cron表达式 – 每年只运行一次
发布时间:2020-12-15 04:32:23 所属栏目:Java 来源:网络整理
导读:我的春季服务喜欢 @Scheduled( cron="0 0 7 * * SUN")public void doSomething() { // do something} 我知道你不能拥有为指定一年保留的第7个值.使用表达式我可以告诉spring在特定时间每年运行一次,比如说在2020年12月25日上午6点? 谢谢 解决方法 是的你可
我的春季服务喜欢
@Scheduled( cron="0 0 7 * * SUN") public void doSomething() { // do something } 我知道你不能拥有为指定一年保留的第7个值.使用表达式我可以告诉spring在特定时间每年运行一次,比如说在2020年12月25日上午6点? 谢谢 解决方法
是的你可以.刚看看
this答案.简而言之,您可以使用以下格式:
0 0 6 6 9 ? 2010 | | | | | | | | | | | | | +- 2010 only. | | | | | +----- any day of the week. | | | | +------- 9th month (September). | | | +--------- 6th day of the month. | | +----------- 6th hour of the day. | +------------- Top of the hour (minutes = 0). +--------------- Top of the minute (seconds = 0). (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |