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


PHP Properties::setDateFrom方法代码示例

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


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

示例1: dirname

<?php

include dirname(__FILE__) . '/../../bootstrap/Doctrine.php';
$t = new lime_test(6, new lime_output_color());
$c = new Properties();
$c->setDateFrom('1830/10/05 00:00:00');
$c->setDateFromMask(56);
$t->is($c->getFromDateMasked(), '05/10/1830 <em>00:00:00</em>', 'The date from Is construct and Masked');
$c->setDateTo('1830/10/05 12:36:00');
$c->setDateToMask(62);
$t->is($c->getToDateMasked(), '05/10/1830 12:36:<em>00</em>', 'The date to Is construct and Masked');
$t->is_deeply($c->getDateTo(), array('year' => 1830, 'month' => 10, 'day' => 5, 'hour' => 12, 'minute' => 36, 'second' => ''), 'The date to is masked as array');
$t->is_deeply($c->getDateFrom(), array('year' => 1830, 'month' => 10, 'day' => 5, 'hour' => '', 'minute' => '', 'second' => ''), 'The date from is masked as array');
$d = new FuzzyDateTime('1830/10/05 00:00:00', 56);
$c->setDateTo($d);
$t->is($c->getToDateMasked(), '05/10/1830 <em>00:00:00</em>', 'The date to Is construct and Masked');
$d = new FuzzyDateTime('1830/10/05 12:36:00', 62);
$c->setDateFrom($d);
$t->is($c->getFromDateMasked(), '05/10/1830 12:36:<em>00</em>', 'The date to Is construct and Masked');
开发者ID:naturalsciences,项目名称:Darwin,代码行数:19,代码来源:PropertiesTest.php


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