Get current timestamp of schedule task

Get current timestamp of schedule task

por Ha Tuan Em -
Number of replies: 2

Hi,

My work is reference to timestamp of schedule task for caculating.

So I do not know how we can get the current timestamp in a schedule task?

Attachment Capture.PNG
Average of ratings: -
In reply to Ha Tuan Em

Re: Get current timestamp of schedule task

por Benjamin Ellis -
Imaxe de Particularly helpful Moodlers
Hi,

Just calling the PHP function time() will give you a timestamp but I am not sure that is what you are trying to do from your message.
In reply to Ha Tuan Em

Re: Get current timestamp of schedule task

por Davo Smith -
Imaxe de Core developers Imaxe de Particularly helpful Moodlers Imaxe de Peer reviewers Imaxe de Plugin developers
All the information about each scheduled task is stored in DB table mdl_task_scheduled.

This includes nextruntime (the timestamp for the next time after which the task will run again) and lastruntime (the timestamp when the task last completed).