当前位置: 首页>>代码示例>>PHP>>正文


PHP FabrikWorker::strToDateTime方法代码示例

本文整理汇总了PHP中FabrikWorker::strToDateTime方法的典型用法代码示例。如果您正苦于以下问题:PHP FabrikWorker::strToDateTime方法的具体用法?PHP FabrikWorker::strToDateTime怎么用?PHP FabrikWorker::strToDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FabrikWorker的用法示例。


在下文中一共展示了FabrikWorker::strToDateTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderListData

 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderListData($data, $oAllRowsData)
 {
     if ($data != '') {
         $format = '%Y-%m-%d %H:%i:%s';
         $timebits = FabrikWorker::strToDateTime($data, $format);
         $data = date('H:i:s', $timebits['timestamp']);
     }
     return $data;
 }
开发者ID:rhotog,项目名称:fabrik,代码行数:15,代码来源:timer.php

示例2: tableDateToMySQL

 /**
  * convert a table formatted date string into a mySQL formatted date string
  * (if already in mySQL format returns the date)
  * @param string date in table view format
  * @return string date in mySQL format or false if string date could not be converted
  */
 function tableDateToMySQL($v)
 {
     $params =& $this->getParams();
     $store_as_local = (int) $params->get('date_store_as_local', 0);
     $format = $params->get('date_table_format', '%Y-%m-%d');
     $b = FabrikWorker::strToDateTime($v, $format);
     if (!is_array($b)) {
         return false;
     }
     //3.0 can't use timestamp as that gets offset as its taken as numeric by JDate
     //$orig = new JDate($datebits['timestamp'], 2);
     $bstr = $b['year'] . '-' . $b['mon'] . '-' . $b['day'] . ' ' . $b['hour'] . ':' . $b['min'] . ':' . $b['sec'];
     $date = JFactory::getDate($bstr);
     if (in_array($v, $this->getNullDates()) || $v === $date->toMySQL()) {
         return $v;
     }
     if ($store_as_local) {
         $this->_resetToGMT = false;
     }
     $retval = $this->toMySQLGMT($date);
     $this->_resetToGMT = true;
     return $retval;
 }
开发者ID:nickbunyan,项目名称:fabrik,代码行数:29,代码来源:date.php

示例3: tableDateToMySQL

 /**
  * convert a table formatted date string into a mySQL formatted date string
  * (if already in mySQL format returns the date)
  * @param string date in table view format
  * @return string date in mySQL format or false if string date could not be converted
  */
 function tableDateToMySQL($v)
 {
     $params =& $this->getParams();
     $store_as_local = (int) $params->get('date_store_as_local', 0);
     if (in_array($v, $this->getNullDates()) || $v === JFactory::getDate($v)->toMySQL()) {
         return $v;
     }
     $format = $params->get('date_table_format', '%Y-%m-%d');
     $datebits = FabrikWorker::strToDateTime($v, $format);
     if (!is_array($datebits)) {
         return false;
     }
     $date =& JFactory::getDate($datebits['timestamp']);
     if ($store_as_local) {
         $this->_resetToGMT = false;
     }
     $retval = $this->toMySQLGMT($date);
     $this->_resetToGMT = true;
     return $retval;
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:26,代码来源:fabrikdate.php

示例4: tableDateToMySQL

 /**
  * Convert a table formatted date string into a mySQL formatted date string
  * (if already in mySQL format returns the date)
  *
  * @param   string  $v  date in table view format
  *
  * @deprecated not used
  *
  * @return  string	date in mySQL format or false if string date could not be converted
  */
 protected function tableDateToMySQL($v)
 {
     $params = $this->getParams();
     $store_as_local = (int) $params->get('date_store_as_local', 0);
     $format = $params->get('date_table_format', '%Y-%m-%d');
     $b = FabrikWorker::strToDateTime($v, $format);
     if (!is_array($b)) {
         return false;
     }
     $bstr = $b['year'] . '-' . $b['mon'] . '-' . $b['day'] . ' ' . $b['hour'] . ':' . $b['min'] . ':' . $b['sec'];
     $date = JFactory::getDate($bstr);
     if (in_array($v, $this->getNullDates()) || $v === $date->toSql()) {
         return $v;
     }
     if ($store_as_local) {
         $this->resetToGMT = false;
     }
     $retval = $this->toMySQLGMT($date);
     $this->resetToGMT = true;
     return $retval;
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:31,代码来源:date.php


注:本文中的FabrikWorker::strToDateTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。