cron="0 30 23 * * ? "
时间: 2024-01-17 18:02:55 浏览: 19
This cron expression means:
"Execute at 23:30 every day."
The breakdown of each field is as follows:
- 0: Represents the seconds field.
- 30: Represents the minutes field.
- 23: Represents the hours field.
- *: Represents the day-of-month field, which means the job will be executed every day of the month.
- *: Represents the month field, which means the job will be executed every month.
- ?: Represents the day-of-week field. When this field is set to ?, it means that the day of the week is not relevant to the expression.
相关问题
cron="0 30 * * * ?"
根据提供的引用内容,cron表达式"cron="0 30 * * * ?" ?"的含义是每小时的第30分钟执行一次。其中,cron表达式的各个字段的含义如下:
- 第一个字段表示秒数,取值范围为0-59。
- 第二个字段表示分钟数,取值范围为0-59。
- 第三个字段表示小时数,取值范围为0-23。
- 第四个字段表示日期,取值范围为1-31。
- 第五个字段表示月份,取值范围为1-12。
- 第六个字段表示星期,取值范围为1-7,其中1表示星期日,2表示星期一,以此类推。
- 第七个字段表示年份,可选项。
因此,cron表达式"cron="0 30 * * * ?" ?"表示每小时的第30分钟执行一次,不受日期、月份和年份的限制。
@Scheduled(cron = "0/30 * * * * ?")
@Scheduled(cron = "0/30 * * * * ?") 是一个Spring框架中的注解,用于定时任务的调度。它表示任务将在每分钟的第0秒开始,并且每隔30秒执行一次。具体的cron表达式解释如下:
- 第一位:表示秒,取值范围是0-59
- 第二位:表示分钟,取值范围是0-59
- 第三位:表示小时,取值范围是0-23
- 第四位:表示日期,取值范围是1-31
- 第五位:表示月份,取值范围是1-12
- 第六位:表示星期几,取值范围是1-7(1表示星期日,2表示星期一,以此类推)
- 第七位:年份(可选),取值范围是1970-2099
所以,@Scheduled(cron = "0/30 * * * * ?") 表示任务将在每分钟的第0秒开始,并且每隔30秒执行一次。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)