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