当前位置: 首页>>代码示例>>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;未经允许,请勿转载。