How to set cron to run at 6 pm

I use “github.com/robfig/cron” and set it c.AddFunc(“0 18 * * ?”, taskList) I want it to run everyday at 6 pm but actually it runs every hour

Hi. 0 is at which seconds and 18 is at which minutes so you have set it to run at 18 past every whole hour.

1 Like

Should I do like that 0 0 18 * * ?

0 0 18 * * * (the last three is day of month, month and weekday) In the documentation: Question mark may be used instead of ‘*’ for leaving either day-of-month or day-of-week blank so 0 0 18 * * ? is ok also.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.