function IsCustomerServiceTime() { $customerServiceTime = GetCustomerServiceTime(); //GMT to EST $timezoneAdjustment = GetConfig('StoreTimeZone'); if (GetConfig('StoreDSTCorrection')) { ++$timezoneAdjustment; } $timezoneAdjustment *= 3600; $currentTime = time() + $timezoneAdjustment; $now = array('week' => date('w', $currentTime), 'hour' => date('G', $currentTime), 'min' => date('i', $currentTime)); $nowtime = $now['hour'] * 60 + $now['min']; $nowdate = ConvertDateToTime(date('m/d/Y', $currentTime)); if ($now['week'] > 0 && $now['week'] < 6) { if ($nowtime > $customerServiceTime['weekday']['from'] && $nowtime < $customerServiceTime['weekday']['to']) { return true; } } if ($now['week'] == 6) { if ($nowtime > $customerServiceTime['saturday']['from'] && $nowtime < $customerServiceTime['saturday']['to']) { return true; } } if ($now['week'] == 0) { if ($nowtime > $customerServiceTime['sunday']['from'] && $nowtime < $customerServiceTime['sunday']['to']) { return true; } } }
public function GetCustomerServiceTime() { return GetCustomerServiceTime(); }