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


PHP Time::setTime方法代碼示例

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


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

示例1: marshalProvider

 /**
  * Data provider for marshal()
  *
  * @return array
  */
 public function marshalProvider()
 {
     $date = new Time('@1392387900');
     $date->setTime(0, 0, 0);
     return [[null, null], [false, null], [true, null], ['', null], ['derpy', 'derpy'], ['2013-nope!', '2013-nope!'], ['14-02-14', '14-02-14'], ['2014-02-14 13:14:15', '2014-02-14 13:14:15'], ['1392387900', $date], [1392387900, $date], ['2014-02-14', new Time('2014-02-14')], [['year' => '', 'month' => '', 'day' => ''], null], [['year' => 2014, 'month' => 2, 'day' => 14, 'hour' => 13, 'minute' => 14, 'second' => 15], new Time('2014-02-14 00:00:00')], [['year' => 2014, 'month' => 2, 'day' => 14, 'hour' => 1, 'minute' => 14, 'second' => 15, 'meridian' => 'am'], new Time('2014-02-14 00:00:00')], [['year' => 2014, 'month' => 2, 'day' => 14, 'hour' => 1, 'minute' => 14, 'second' => 15, 'meridian' => 'pm'], new Time('2014-02-14 00:00:00')], [['year' => 2014, 'month' => 2, 'day' => 14], new Time('2014-02-14 00:00:00')], [['year' => 'farts', 'month' => 'derp'], new Time(date('Y-m-d 00:00:00'))], [['year' => 'farts', 'month' => 'derp', 'day' => 'farts'], new Time(date('Y-m-d 00:00:00'))], [['year' => '2014', 'month' => '02', 'day' => '14', 'hour' => 'farts', 'minute' => 'farts'], new Time('2014-02-14 00:00:00')]];
 }
開發者ID:neilan35,項目名稱:betterwindow1,代碼行數:11,代碼來源:DateTypeTest.php


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