From 513177688fbb12b7a40c06151b2295fb7d70f730 Mon Sep 17 00:00:00 2001 From: fusionate Date: Sat, 23 Sep 2023 14:50:51 +0000 Subject: [PATCH] Active Calls: Adjust Created time to correct timezone. --- app/calls_active/calls_active_inc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/calls_active/calls_active_inc.php b/app/calls_active/calls_active_inc.php index abfabe5408..348bf47894 100644 --- a/app/calls_active/calls_active_inc.php +++ b/app/calls_active/calls_active_inc.php @@ -92,6 +92,8 @@ } $num_rows = @sizeof($rows); +//set the time zone + $time_zone = $_SESSION['domain']['time_zone']['name'] ?? date_default_timezone_get(); //if the connnection is available then run it and return the results if (!$fp) { @@ -181,6 +183,13 @@ $$key = $value; } + //adjust created date and time to time zone + if ($time_zone != date_default_timezone_get()) { + $date = new DateTime($created, new DateTimeZone(date_default_timezone_get())); + $date->setTimeZone(new DateTimeZone($time_zone)); + $created = $date->format('Y-m-d H:i:s'); + } + //get the sip profile $name_array = explode("/", $name); $sip_profile = $name_array[1]; @@ -202,7 +211,7 @@ } // reduce too long app data - if(strlen($application_data) > 512) { + if (strlen($application_data) > 512) { $application_data = substr($application_data, 0, 512) . '...'; }