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


PHP TimeDate::nowDb方法代碼示例

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


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

示例1: testHandleOffset

 public function testHandleOffset()
 {
     $gmt_today = $this->time_date->nowDb();
     $date1 = $this->time_date->handle_offset($gmt_today, $GLOBALS['timedate']->get_db_date_time_format());
     $date2 = $this->time_date->nowDb();
     $this->assertEquals($date1, $date2, "HandleOffset should be equaivalent to nowDb");
 }
開發者ID:delkyd,項目名稱:sugarcrm_dev,代碼行數:7,代碼來源:CalendarTest.php

示例2: testGetDB

 /**
  * test getting DB date formats indifferent ways
  */
 public function testGetDB()
 {
     $this->assertEquals(gmdate($this->time_date->merge_date_time($this->time_date->get_db_date_format(), $this->time_date->get_db_time_format())), $this->time_date->nowDb());
 }
開發者ID:nickpro,項目名稱:sugarcrm_dev,代碼行數:7,代碼來源:TimeDateTest.php

示例3: track_slow_queries

 /**
  * Tracks slow queries in the tracker database table
  *
  * @param string $query  value of query to track
  */
 protected function track_slow_queries($query)
 {
     $trackerManager = TrackerManager::getInstance();
     if ($trackerManager->isPaused()) {
         return;
     }
     if ($monitor = $trackerManager->getMonitor('tracker_queries')) {
         $monitor->setValue('date_modified', $this->timedate->nowDb());
         $monitor->setValue('text', $query);
         $monitor->setValue('sec_total', $this->query_time);
         //Save the monitor to cache (do not flush)
         $trackerManager->saveMonitor($monitor, false);
     }
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:19,代碼來源:DBManager.php

示例4: handleDateFormat

 /**
  * handles some date/time foramtting
  * @param string time Time (usually "now")
  * @param object user User, usually admin (id = '1')
  * @param boolean to_local, convert to user's time format
  * @return string formatted time.
  */
 function handleDateFormat($time, $user = null, $to_local = true)
 {
     global $timedate;
     if (!isset($timedate) || empty($timedate)) {
         $timedate = new TimeDate();
     }
     // get proper user
     $user = empty($user) ? $this->user : $user;
     $dbTime = $timedate->nowDb();
     if ($to_local) {
         $ret = $timedate->to_display_date_time($dbTime, true, true, $user);
         return $ret;
     }
     return $dbTime;
 }
開發者ID:razorinc,項目名稱:sugarcrm-example,代碼行數:22,代碼來源:SchedulersJob.php


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