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


PHP Properties::setDateFromMask方法代碼示例

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


在下文中一共展示了Properties::setDateFromMask方法的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::setDateFromMask方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。