本文整理匯總了PHP中CDate::subtractSeconds方法的典型用法代碼示例。如果您正苦於以下問題:PHP CDate::subtractSeconds方法的具體用法?PHP CDate::subtractSeconds怎麽用?PHP CDate::subtractSeconds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CDate
的用法示例。
在下文中一共展示了CDate::subtractSeconds方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: clickWeek
window.location = './index.php?m=calendar&a=day_view&date='+uts;
}
function clickWeek( uts, fdate ) {
window.location = './index.php?m=calendar&a=week_view&date='+uts;
}
</script>
<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>
<?php
// establish the focus 'date'
$date = new CDate($date);
// prepare time period for 'events'
$first_time = new CDate($date);
$first_time->setDay(1);
$first_time->setTime(0, 0, 0);
$first_time->subtractSeconds(1);
$last_time = new CDate($date);
$last_time->setDay($date->getDaysInMonth());
$last_time->setTime(23, 59, 59);
$links = array();
// assemble the links for the tasks
require_once dPgetConfig('root_dir') . "/modules/calendar/links_tasks.php";
getTaskLinks($first_time, $last_time, $links, 20, $company_id);
// assemble the links for the events
require_once dPgetConfig('root_dir') . "/modules/calendar/links_events.php";
getEventLinks($first_time, $last_time, $links, 20);
// create the main calendar
$cal = new CMonthCalendar($date);
$cal->setStyles('motitle', 'mocal');
$cal->setLinkFunctions('clickDay', 'clickWeek');
$cal->setEvents($links);
示例2: getBeginWeek
function getBeginWeek($d)
{
$dn = intval($d->Format("%w"));
$dd = new CDate($d);
$dd->subtractSeconds($dn * 24 * 3600);
return intval($dd->Format("%U"));
}