如果提交后已经过了一小时,则更新记录

I know there are many questions like this but I cannot make them apply to my situation, I am having trouble working with time differences.

Iam using Code Igniter and I have a db that has rows of "jobs" in it with various fields, one being submitted_time (of type TIME) which is set to date('H:i:s', time()) at the time of insertion and the other service_response(of type TIME) which is set manually to "02:00:00" at insertion.

I am trying to write a function that when ran checks if an hour has passed since the post was added, but am having trouble understanding the best way to accomplish this.

Below is my attempt which was to convert all the strings from the two fields to a unix time stamp and echo out the "job" if the time submitted is greater than than the time now + 1 hour (service_response/2)

function updateJobTimes()
{
    $this->load->model('job_model');

    $oj = $this->job_model->getAllTodaysOpenJobs();
    //var_dump($oj);
    foreach($oj as $job) 
    {
        $timesubmitted = strtotime($job->submitted_time);
        $now = strtotime(date('H:i:s', time()));
        //responsetime = now + 1 hour;
        $responsetime = strtotime("+1 hours");

        echo "Submitted_time =" . $job->submitted_time. "<br>
";
        echo "strtotime(Submitted_time) =". $timesubmitted. "<br>
";
        echo "Service_reponse =" . $job->service_response. "<br>
";
        echo "strtotime(Serivce_response) =" .$responsetime. "<br>
";
        echo "Time now =".$now. "<br>";
        echo "response time(now +1hour) =". date('H:i:s', $responsetime) ."<br>";
        echo "-----just a separator---------------------------------- <br>";




        //this should show the last job "job#2105" which is the last iteration in the picture below 
        if($timesubmitted > $responsetime)
        {
            $difference = $res - $timesubmitted;
            echo "<p class='well'>Job #".$job->reference. "</p>
";
        }
    }
}

But it is never or always meeting the condition.

I am genuinely at a loss and have read every question that turned up in google but they are either based around the time and date being in the same field or wanting to return a user readable string like "x Minutes ago" or they use a sql select statement but I already have a statement that only pulls back jobs from the current day(above), I just want to list these jobs out if they have been submitted for more than an hour.

Sorry if the question it too long, too stupid or doesn't provide enough information(or too much), I am asking because I am lost.

EDIT: Updated Method A with help of @ChrisG and added a picture to display the problem (that last job(#2105) shouldn't be there)

EDIT 2:Updated method again and update the picture to show what both variables are that are being checked.

**EDIT 3: I have a feeling looking at my code that the condition will never be met because the submitted time will never be greater than whatever time it is now +1 hour since now will always change...I feel stupid just writing that out, but I cant seem to get it right the right if statement, I feel closer now than earlier but still lost. Maybe response time should be the submitted time + one hour? **

thank you for reading

The var dumps of the variables

enter image description here

I figured it out.

function updateJobTimes()
{
    $this->load->model('job_model');

    $oj = $this->job_model->getAllTodaysOpenJobs();
    //var_dump($oj);
    foreach($oj as $job) 
    {
        $timesubmitted = strtotime($job->submitted_time);
        $now = strtotime(date('H:i:s', time()));

        $responsetime = strtotime("+1 hours", $timesubmitted);

        // echo "Submitted_time =" . $job->submitted_time. "<br>
";
        // echo "strtotime(Submitted_time) =". $timesubmitted. "<br>
";
        // echo "strtotime(Serivce_response) =" .$responsetime. "<br>
";
        // echo "Time now =".$now. "<br>";
        // echo "response time(now +1hour) =". date('H:i:s', $responsetime) ."<br>";
        // echo "-----just a separator---------------------------------- <br>";





        if($now > $responsetime)
        {
            //$difference = $res - $timesubmitted;
            echo "<p class='well'>Job #".$job->reference. " was submitted at ".date('H:i:s',$timesubmitted). " and its response time is " .date('H:i:s',$responsetime). " and it is now ".date('H:i:s',time()). "</p>
";
        }
    }
}

Basically I was doing if(the time submitted was greater than the time submitted + 1hour) which will always be true what I should have been doing is if(**thetimenow** is greater than time_submitted + 1 hour) //which in my case should return all the results except 1, which it does, hope it helps anyone as confused as I was.

Not really sure of the etiquette of accepting your own answer as the solution so i wont, but this does work for me and frankly probably already makes sense to most people, I just got caught up in the problem.