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