本文整理汇总了PHP中CDate::Date方法的典型用法代码示例。如果您正苦于以下问题:PHP CDate::Date方法的具体用法?PHP CDate::Date怎么用?PHP CDate::Date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDate
的用法示例。
在下文中一共展示了CDate::Date方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CDate
if ($start_date && $end_date) {
$min_d_start = new CDate($start_date);
$max_d_end = new CDate($end_date);
$graph->SetDateRange($start_date, $end_date);
} else {
// find out DateRange from gant_arr
$d_start = new CDate();
$d_end = new CDate();
for ($i = 0, $xi = count(@$projects); $i < $xi; $i++) {
//GT [BugFix]
$p = $projects[$i];
//GT
$start = mb_substr($p['project_start_date'], 0, 10);
$end = mb_substr($p['project_end_date'], 0, 10);
$d_start->Date($start);
$d_end->Date($end);
if ($i == 0) {
$min_d_start = $d_start;
$max_d_end = $d_end;
} else {
if (Date::compare($min_d_start, $d_start) > 0) {
$min_d_start = $d_start;
}
if (Date::compare($max_d_end, $d_end) < 0) {
$max_d_end = $d_end;
}
}
}
}
// check day_diff and modify Headers
$day_diff = $max_d_end->dateDiff($min_d_start);
示例2: CDate
//month number
//-----------------------------------------
if ($start_date && $end_date) {
$min_d_start = new CDate($start_date);
$max_d_end = new CDate($end_date);
$graph->SetDateRange($start_date, $end_date);
} else {
// find out DateRange from gant_arr
$d_start = new CDate();
$d_end = new CDate();
$i = 0;
foreach ($projects as $project) {
$start = substr($project["project_start_date"], 0, 10);
$end = substr($project["project_actual_end_date"], 0, 10);
$start == '' || $start == null || $start == '0000-00-00' ? $d_start->Date() : $d_start->Date($start);
$end == '' || $end == null || $end == '0000-00-00' ? $d_end->Date() : $d_end->Date($end);
if ($i == 0) {
$min_d_start = $d_start;
$max_d_end = $d_end;
} else {
if (Date::compare($min_d_start, $d_start) > 0) {
$min_d_start = $d_start;
}
if (Date::compare($max_d_end, $d_end) < 0) {
$max_d_end = $d_end;
}
}
$i++;
}
}
// check day_diff and modify Headers