示例#1
0
 static function create($hour = -1, $minute = -1, $second = -1)
 {
     $cur_date = getdate();
     $time = new eZTime();
     $time->setHMS($hour < 0 ? $cur_date['hours'] : $hour, $minute < 0 ? $cur_date['minutes'] : $minute, $second < 0 ? $cur_date['seconds'] : $second);
     return $time;
 }
示例#2
0
 function fromString($contentObjectAttribute, $string)
 {
     if ($string != '') {
         list($hour, $minute, $second) = explode(':', $string);
         if ($hour == '' || $minute == '') {
             return false;
         }
         if ($second == '') {
             $second = 0;
         }
         $time = new eZTime();
         $time->setHMS($hour, $minute, $second);
         $contentObjectAttribute->setAttribute('data_int', $time->timeOfDay());
     }
     return true;
 }