I have following code:
$start_time="6:00 PM";
$end_time="10:00 PM";
The above time are according the countries timezone i.e (Asia/Colombo, Asia/Adelaide...etc)
And I want to perform the following calcuation:
date_default_timezone_set("UTC");
$system_time = date('g:i A'); //Getting the system time according to the UTC timezone
$time_left_for_discussion = $start_time - $system_time;
if ($system_day < $day) {
return "Upcoming";
} else if ($system_day == $day) {
if ($time_left_for_discussion <= 0 && $system_time <= $end_time) {
return "Live";
} else {
return "NA";
}
} else {
return "NA";
}
Here the $system_time is according the UTC timezone. Now I want calculation for $time_left_for_discussion so for that I need need to convert $start_time and $end_time in UTC format for correct calucation.
Hope you got my point.