Schedule
job.schedule(time)
job.schedule(time)
The schedule
method sets a job to run at a specific time determined by the input parameter. This method accepts both Date
objects and date strings, providing flexibility in scheduling jobs.
This does NOT save the job in the database. you must explicitly declare save()
if you want to save it
Example Usage
Parameters
time
(string | Date
): The time at which the job is scheduled to run. This can be aDate
object representing the exact time for the job to run.
Returns
Job
: Returns the job instance with the updatednextRunAt
attribute, allowing for method chaining.
Last updated