I am writing a smart app with nodeJs. in the update section, I want to schedule a command for a specific time. (every day 6pm)
here is my code:
const cronExpression = “0 0 18 * * ?”;
await context.api.schedules.schedule(‘lightOn’, cronExpression);
error message : “‘?’ can only be specfied for Day-of-Month or Day-of-Week.”
I tried other formats too but getting other errors:
“Support for specifying both a day-of-week AND a day-of-month parameter is not implemented”
" The cron expression for the schedule for CRON schedules. The format matches that specified by the Quartz scheduler but should not include the seconds (1st) field. The exact second will be chosen at random but will remain consistent. The years part must be les than 2 years from now."