I have a situation which requires to run a function in a controller at a particular instance of time. E.G. i want to execute it on these dates:
$Q1 = 2016-03-31 23:59:59, $Q2 = 2016-06-30 23:59:59, $Q3 = 2016-09-30 23:59:59, $Q4 = 2016-12-31 23:59:59
The code of function is as under:
function whenToResetIdGeneratorTable()
{
$db = $this->session->userdata('db');
$labid = 1;
$this->load->model('labbranches');
$labtablename = $this->labbranches->getLabTableName($labid, $db);
$classname;
foreach($labtablename as $index => $arr)
{
foreach($arr as $key => $value){
$classname = $value;
}//end inner loop
} //end outer loop
$this->load->model(''.$classname.'');
$result = $this->$classname->resetTable($db);
echo json_encode($quart1);
}
But i dont know how to periodically call this function after determining the right date and time?