40

Quartz Scheduler 中每个格林威治标准时间午夜 12 点运行程序的 cron 表达式是什么。

我以前从未使用过石英,所以我还在学习。

是表达式0 0 12 * * ?还是 for 12 pm (noon)。谁能告诉我?

4

3 回答 3

90

1 秒 2 分钟 3 小时 4 月份 5 个月 6 星期 7 年(可选字段)

所以在你的情况下:

0 0 0 * * ?

如果你想在中午开火,这将在午夜开火:

0 0 12 * * ?

或两者:

0 0 0,12 * * ?

如果您想变得更复杂,这是一个很好的页面:http ://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-06

祝你有愉快的一天!

于 2012-06-21T21:06:18.810 回答
25
<Minute> <Hour> <Day_of_the_Month> <Month_of_the_Year> <Day_of_the_Week>

The following graph shows what it consists of:

* * * * * *
| | | | | | 
| | | | | +-- Year              (range: 1900-3000)
| | | | +---- Day of the Week   (range: 1-7, 1 standing for Monday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month  (range: 1-31)
| +---------- Hour              (range: 0-23)
+------------ Minute            (range: 0-59)

Cron Expression for a program to run every midnight at 12 am.

0 0 0 1/1 * ? *

A great website to create your own Cron Expression easily without much knowledge of Cron Expression : Cron Maker

It will help you build your own cron expression and show you the next firing date times of your cron like this.

1.  Wednesday, July 6, 2016 12:00 AM
2.  Thursday, July 7, 2016 12:00 AM
3.  Friday, July 8, 2016 12:00 AM
4.  Saturday, July 9, 2016 12:00 AM
5.  Sunday, July 10, 2016 12:00 AM .....
于 2016-07-05T10:40:37.237 回答
1

每个午夜 12 点运行的程序的 Cron 表达式应为 0 0 0 * * *

于 2018-10-05T05:12:52.650 回答