本文整理匯總了PHP中eZDateTime::setTimeStamp方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZDateTime::setTimeStamp方法的具體用法?PHP eZDateTime::setTimeStamp怎麽用?PHP eZDateTime::setTimeStamp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZDateTime
的用法示例。
在下文中一共展示了eZDateTime::setTimeStamp方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: objectAttributeContent
function objectAttributeContent( $contentObjectAttribute )
{
$dateTime = new eZDateTime();
$stamp = $contentObjectAttribute->attribute( 'data_int' );
$dateTime->setTimeStamp( $stamp );
return $dateTime;
}
示例2: getTimestamp
function getTimestamp($http, $id)
{
$day = $http->postVariable('newsletter_datetime_day_' . $id);
$month = $http->postVariable('newsletter_datetime_month_' . $id);
$year = $http->postVariable('newsletter_datetime_year_' . $id);
$hour = $http->postVariable('newsletter_datetime_hour_' . $id);
$minute = $http->postVariable('newsletter_datetime_minute_' . $id);
$dateTime = new eZDateTime();
if ($year == '' and $month == '' and $day == '' and $hour == '' and $minute == '' or !checkdate($month, $day, $year) or $year < 1970) {
$dateTime->setTimeStamp(0);
} else {
$dateTime->setMDYHMS($month, $day, $year, $hour, $minute, 0);
}
return $dateTime->timeStamp();
}