function objectAttributeContent( $contentObjectAttribute ) { $dateTime = new eZDateTime(); $stamp = $contentObjectAttribute->attribute( 'data_int' ); $dateTime->setTimeStamp( $stamp ); return $dateTime; }
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(); }