本文整理汇总了PHP中TTDate::setTimeUnitFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP TTDate::setTimeUnitFormat方法的具体用法?PHP TTDate::setTimeUnitFormat怎么用?PHP TTDate::setTimeUnitFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTDate
的用法示例。
在下文中一共展示了TTDate::setTimeUnitFormat方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
global $db, $cache, $profiler;
require_once '../includes/global.inc.php';
$profiler = new Profiler(true);
Debug::setBufferOutput(FALSE);
Debug::setEnable(TRUE);
TTDate::setTimeUnitFormat(10);
//HH:MM
if (PRODUCTION != FALSE) {
echo "DO NOT RUN ON A PRODUCTION SERVER<br>\n";
exit;
}
}
示例2: setUp
public function setUp()
{
Debug::text('Running setUp(): ', __FILE__, __LINE__, __METHOD__, 10);
TTDate::setTimeZone('PST8PDT');
TTDate::setTimeUnitFormat(10);
//HH:MM
$dd = new DemoData();
$dd->setEnableQuickPunch(FALSE);
//Helps prevent duplicate punch IDs and validation failures.
$dd->setUserNamePostFix('_' . uniqid(NULL, TRUE));
//Needs to be super random to prevent conflicts and random failing tests.
$this->company_id = $dd->createCompany();
Debug::text('Company ID: ' . $this->company_id, __FILE__, __LINE__, __METHOD__, 10);
$this->assertGreaterThan(0, $this->company_id);
//$dd->createPermissionGroups( $this->company_id, 40 ); //Administrator only.
return TRUE;
}
示例3: parse_wage_weekly_time
function parse_wage_weekly_time($input, $default_value = NULL, $parse_hint = NULL)
{
if (isset($parse_hint) and $parse_hint != '') {
TTDate::setTimeUnitFormat($parse_hint);
}
$retval = TTDate::parseTimeUnit($input);
return $retval;
}
示例4: parse_amount
function parse_amount($input, $default_value = NULL, $parse_hint = NULL, $raw_row = NULL)
{
$val = new Validator();
TTDate::setTimeUnitFormat($parse_hint);
$retval = TTDate::parseTimeUnit($val->stripNonFloat($input));
return $retval;
}
示例5: testTimeUnit3
function testTimeUnit3()
{
Debug::text('Testing Time Unit Format: Decimal', __FILE__, __LINE__, __METHOD__, 10);
TTDate::setDateFormat('dMY');
TTDate::setTimeZone('PST');
TTDate::setTimeFormat('g:i A');
/*
10 => 'hh:mm (2:15)',
12 => 'hh:mm:ss (2:15:59)',
20 => 'Hours (2.25)',
22 => 'Hours (2.241)',
30 => 'Minutes (135)'
*/
TTDate::setTimeUnitFormat(20);
$this->assertEquals(TTDate::parseTimeUnit('0.02'), 1 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.03'), 2 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.05'), 3 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.07'), 4 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.08'), 5 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.10'), 6 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.12'), 7 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.13'), 8 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.15'), 9 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.17'), 10 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.18'), 11 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.20'), 12 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.22'), 13 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.23'), 14 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.25'), 15 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.27'), 16 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.28'), 17 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.30'), 18 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.32'), 19 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.33'), 20 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.35'), 21 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.37'), 22 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.38'), 23 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.40'), 24 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.42'), 25 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.43'), 26 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.45'), 27 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.47'), 28 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.48'), 29 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.50'), 30 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.52'), 31 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.53'), 32 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.55'), 33 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.57'), 34 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.58'), 35 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.60'), 36 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.62'), 37 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.63'), 38 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.65'), 39 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.67'), 40 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.68'), 41 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.70'), 42 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.72'), 43 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.73'), 44 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.75'), 45 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.77'), 46 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.78'), 47 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.80'), 48 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.82'), 49 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.84'), 50 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.85'), 51 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.87'), 52 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.89'), 53 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.90'), 54 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.92'), 55 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.94'), 56 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.95'), 57 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.97'), 58 * 60);
$this->assertEquals(TTDate::parseTimeUnit('0.99'), 59 * 60);
$this->assertEquals(TTDate::parseTimeUnit('1.00'), 60 * 60);
}
示例6: setDateTimePreferences
function setDateTimePreferences()
{
//TTDate::setTimeZone( $this->getTimeZone() );
if ($this->setTimeZonePreferences() == FALSE) {
//In case setting the time zone failed, most likely due to MySQL timezone issues.
return FALSE;
}
TTDate::setDateFormat($this->getDateFormat());
TTDate::setTimeFormat($this->getTimeFormat());
TTDate::setTimeUnitFormat($this->getTimeUnitFormat());
return TRUE;
}