Problem with parameter type date to subtract

QuestionsProblem with parameter type date to subtract
C3media asked 8 years ago

Hello,

I'm trying to subtract two different hours using this function:

function update_data($data)
{
date_default_timezone_set('America/Bogota');
$date1 = date("Y-m-d H:i:s");
$date2 = $data["params"]["note"];

//Convert them to timestamps.
$date1Timestamp = strtotime($date1);
$date2Timestamp = strtotime($date2);

//Calculate the difference.
$difference = ($date2Timestamp – $date1Timestamp)/60;
$diferencia= number_format($difference, 0, '.', ' ');

$data["params"]["staff_note"] = $date1;

$data["params"]["total_discount"] = $data["params"]["total"] – $data["params"]["product_discount"];

$data["params"]["sale_status"] = "Completed";

$data["params"]["due_date"] = $diferencia;

$data["params"]["updated_by"] = $data["params"]["reference_no"] – $data["params"]["due_date"];

$data["params"]["updated_at"] = $data["params"]["updated_by"] * 500;

$data["params"]["paid"] = $data["params"]["grand_total"] + $data["params"]["updated_at"];
}

With pure PHP works fine, but in grid there is problem because update cols with this value: -24 807 112 to all grid.

Thanks by your help

2 Answers
Abu Ghufran answered 8 years ago

Resolved via remote session.

C3media answered 8 years ago

Thank you very much Abu!

Your Answer

20 + 9 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?