public static function update_date($courseid, $timeshift) {
        if ($criteria = self::fetch(array('course' => $courseid))) {
            $criteria->timeend = $criteria->timeend + $timeshift;
            $criteria->update();
        }
    }