Function attached to cron job not running but will run if called manually

It looks like the time() was not set correctly in the first iteration of the function wp_schedule_event;

  1. First, remove this task from the queue by adding a function wp_clear_scheduled_hook and reload the page. For your example: wp_clear_scheduled_hook( 'opportunities_cron_job' );
  2. Remove the cleaning function.
  3. Restart your code. If your date is not set correctly again, use the time in UNIX format, for example, ʼ1701009175ʼ and repeat all actions again.

tech