本文整理匯總了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')]];
}