當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Helper::incrementDateByTimezone方法代碼示例

本文整理匯總了PHP中Library\Utility\Helper::incrementDateByTimezone方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helper::incrementDateByTimezone方法的具體用法?PHP Helper::incrementDateByTimezone怎麽用?PHP Helper::incrementDateByTimezone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Library\Utility\Helper的用法示例。


在下文中一共展示了Helper::incrementDateByTimezone方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getIncrementedDateCity

 /**
  * @param $cityId
  * @param $hours
  * @return bool|string
  */
 public function getIncrementedDateCity($cityId, $hours)
 {
     $cityDao = new \DDD\Dao\Geolocation\Cities($this->getServiceLocator(), 'ArrayObject');
     $city = $cityDao->fetchOne(['id' => $cityId], ['timezone']);
     if ($city && $city['timezone']) {
         return Helper::incrementDateByTimezone($city['timezone'], $hours, 'Y-m-d H:i:s');
     }
     return date('Y-m-d H:i:s');
 }
開發者ID:arbi,項目名稱:MyCode,代碼行數:14,代碼來源:Location.php

示例2: ajaxReportIncidentAction

 public function ajaxReportIncidentAction()
 {
     /**
      * @var \DDD\Dao\Booking\Booking $reservationDao
      * @var \DDD\Service\Task $taskService
      */
     $user = $this->getServiceLocator()->get('library_backoffice_auth');
     $taskService = $this->getServiceLocator()->get('service_task');
     $request = $this->getRequest();
     $result = ['status' => 'success', 'msg' => 'Incident report has been created.', 'title' => '', 'taskId' => 0];
     $taskId = (int) $request->getPost('task_id', 0);
     try {
         if ($request->isXmlHttpRequest() && $taskId) {
             $task = $taskService->getTaskDao()->getTaskById($taskId);
             $apartmentId = $task->getProperty_id();
             $buildingId = $task->getBuildingId();
             $resId = $task->getResId();
             $timezone = $task->getTimezone();
             $currentDateCity = Helper::getCurrenctDateByTimezone($timezone, 'Y-m-d H:i:s');
             $ninetySixHoursLaterDateCity = Helper::incrementDateByTimezone($timezone, 96, 'Y-m-d H:i:s');
             $userId = $user->getIdentity()->id;
             $creator = $user->getIdentity()->id;
             switch ((int) $request->getPost('incident_type', 0)) {
                 case HouseKeeping::INCIDENT_REPORT_EVIDENCE_OF_SMOKING:
                     $damageType = 'There was evidence of smoking';
                     break;
                 case HouseKeeping::INCIDENT_REPORT_KEYS_WERE_NOT_RETURNED:
                     $damageType = 'The keys were not returned';
                     break;
                 case HouseKeeping::INCIDENT_REPORT_DIRTY_HOUSE:
                     $damageType = 'The house was left in a unusually dirty condition';
                     break;
                 case HouseKeeping::INCIDENT_REPORT_BROKEN_FURNITURE:
                     $damageType = 'There was broken furniture';
                     break;
                 case HouseKeeping::INCIDENT_REPORT_OTHER:
                     $damageType = $request->getPost('description', 'Incident Report');
                     break;
             }
             $title = $damageType;
             $description = '';
             $incidentTaskId = $taskService->createReportIncidentTask($resId, $apartmentId, $buildingId, $currentDateCity, $ninetySixHoursLaterDateCity, $title, $creator, $description, $userId, $taskId);
             $result['title'] = $title;
             $result['taskId'] = $incidentTaskId;
         }
     } catch (\Exception $e) {
         $result['status'] = 'error';
         $result['msg'] = TextConstants::SERVER_ERROR;
     }
     return new JsonModel($result);
 }
開發者ID:arbi,項目名稱:MyCode,代碼行數:51,代碼來源:HousekeepingTasksController.php


注:本文中的Library\Utility\Helper::incrementDateByTimezone方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。