本文整理汇总了PHP中DateHelper::getDate方法的典型用法代码示例。如果您正苦于以下问题:PHP DateHelper::getDate方法的具体用法?PHP DateHelper::getDate怎么用?PHP DateHelper::getDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateHelper
的用法示例。
在下文中一共展示了DateHelper::getDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeAllInstancesFromDate
/**
* Deletes all show instances of current show after a
* certain date.
*
* @param string $p_date
* The date which to delete after, if null deletes from the current timestamp.
*/
public function removeAllInstancesFromDate($p_date = null)
{
global $CC_DBC;
$date = new DateHelper();
$timestamp = $date->getTimestamp();
if (is_null($p_date)) {
$date = new DateHelper();
$p_date = $date->getDate();
}
$showId = $this->getId();
$sql = "DELETE FROM cc_show_instances " . " WHERE date(starts) >= DATE '{$p_date}'" . " AND starts > TIMESTAMP '{$timestamp}'" . " AND show_id = {$showId}";
$CC_DBC->query($sql);
/*
CcShowInstancesQuery::create()
->filterByDbShowId($showId)
->filterByDbStartTime($p_date, Criteria::GREATER_EQUAL)
->delete();
*/
}
示例2: getDateTime
public static function getDateTime($ts)
{
return DateHelper::getDate($ts) . " " . DateHelper::getTime($ts);
}