Get current timestamp of schedule task

Get current timestamp of schedule task

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?

附件 Capture.PNG
評比平均分數: -
In reply to Ha Tuan Em

Re: Get current timestamp of schedule task

Benjamin Ellis發表於
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

Davo Smith發表於
Core developers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 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).