A date/time after which this document will be automatically purged.
164601
public Date getExpirationDate() {
        long timestamp = database.expirationOfDocument(documentId);
        if (timestamp == 0)
            return null;
        return new Date(timestamp);
    }
665068
def clean(self):
        """"""
        cleaned_data = super(DatasetUploadForm, self).clean()
        date_begin = self.cleaned_data.get('date_begin')
        date_end = self.cleaned_data.get('date_end')
        if date_end < date_begin:
            msg = u'End date should be after start date.'
            self.add_error('date_begin', msg)
            self.add_error('date_end', msg)
        return cleaned_data
227202
protected function cleanupAction()
    {
        $days = 2;
        $date = new \DateTime();
        $date->modify("-$days day");

        $filter = array("before" => $date->format("Y-m-d"),
                        "isDraft" => 1);
        
        $applications    = $this->fetchApplications($filter);
        $documentManager = $this->documentManager;

        $count = count($applications);
        $i=0;

        echo  $count . " applications in Draft Mode and older than " . $days . " days will be deleted\n";

        $progress = new ProgressBar($count);

        foreach ($applications as $application) {
            $progress->update($i++, 'Application ' . $i . ' / ' . $count);
            try {
                $documentManager->remove($application);
            } catch (\Exception $e) {
                // log something
                $e->getCode();
            }
        }
        $progress->update($i, 'clean up database');
        $documentManager->flush();
        $progress->finish();
    }
314068
def clean_old_jobs():
    '''
    
    '''
    if __opts__.get('keep_jobs', False) and int(__opts__.get('keep_jobs', 0)) > 0:
        try:
            with _get_serv() as cur:
                sql = 'select date_sub(now(), interval {0} hour) as stamp;'.format(__opts__['keep_jobs'])
                cur.execute(sql)
                rows = cur.fetchall()
                stamp = rows[0][0]

            if __opts__.get('archive_jobs', False):
                _archive_jobs(stamp)
            else:
                _purge_jobs(stamp)
        except MySQLdb.Error as e:
            log.error('Mysql returner was unable to get timestamp for purge/archive of jobs')
            log.error(six.text_type(e))
            raise salt.exceptions.SaltRunnerError(six.text_type(e))
964408
public Date[] purgeDatastream(Context context,
                                  String pid,
                                  String datastreamID,
                                  Date startDT,
                                  Date endDT,
                                  String logMessage) throws ServerException {
        return worker.purgeDatastream(context,
                                      pid,
                                      datastreamID,
                                      startDT,
                                      endDT,
                                      logMessage);
    }
854090
def remove(self, document_id, namespace, timestamp):
        """"""
        index, doc_type = self._index_and_mapping(namespace)

        action = {
            '_op_type': 'delete',
            '_index': index,
            '_type': doc_type,
            '_id': u(document_id)
        }

        meta_action = {
            '_op_type': 'delete',
            '_index': self.meta_index_name,
            '_type': self.meta_type,
            '_id': u(document_id)
        }

        self.index(action, meta_action)
73111
def purge(self):
    
    purged_count = 0
    if self.__expiration is not None:
      with self.__connection:
        if self.__caching_strategy is CachingStrategy.FIFO:
          # dump least recently added rows
          for post in (False, True):
            purged_count += self.__connection.execute("DELETE FROM " +
                                                      self.getDbTableName(post=post) + " "
                                                      "WHERE (strftime('%s', 'now') - added_timestamp) > ?;",
                                                      (self.__expiration,)).rowcount
        elif self.__caching_strategy is CachingStrategy.LRU:
          # dump least recently accessed rows
          for post in (False, True):
            purged_count += self.__connection.execute("DELETE FROM " +
                                                      self.getDbTableName(post=post) + " "
                                                      "WHERE (strftime('%s', 'now') - last_accessed_timestamp) > ?;",
                                                      (self.__expiration,)).rowcount
    return purged_count
165818
public void purge(@NonNull String id) throws CouchbaseLiteException {
        if (id == null) { throw new IllegalArgumentException("document id cannot be null."); }

        synchronized (lock) {
            boolean commit = false;
            beginTransaction();
            try {
                getC4Database().purgeDoc(id);
                commit = true;
            }
            catch (LiteCoreException e) {
                throw CBLStatus.convertException(e);
            }
            finally {
                endTransaction(commit);
            }
        }
    }
235040
def remove(self, document_id, namespace, timestamp):
        
        self.solr.delete(id=u(document_id),
                         commit=(self.auto_commit_interval == 0))
1017171
def auto_invalidate(self):
        
        current = datetime.now()
        if current > self._invalidated + timedelta(seconds=self._timetolive):
            self.invalidate()
573477
def cleanup(self):
        
        now = time.time()
        expired = now - NODE_TIMEOUT
        if self.conn.zremrangebyscore(self.key, 0, expired):
            self._notify()
706168
function() {
        if(DT._elColumnDragTarget) {
            var el = DT._elColumnDragTarget;
            YAHOO.util.Event.purgeElement(el);
            el.parentNode.removeChild(el);
            DT._elColumnDragTarget = null;
            
        }
    }
361541
function () {
                    script.onreadystatechange = script.onload = script.onerror = null;
                    rawDocument.body.removeChild(script);
                    if (done) {
                        done();
                    }
                }
528821
protected function purgeOldCodesFromDatabase()
    {
        if ($this->use_database && $this->pdo_conn) {
            $now   = time();
            $limit = (!is_numeric($this->expiry_time) || $this->expiry_time < 1) ? 86400 : $this->expiry_time;

            $query = sprintf("DELETE FROM %s WHERE %s - created > %s",
                             $this->database_table,
                             $now,
                             $this->pdo_conn->quote("$limit", PDO::PARAM_INT));

            $result = $this->pdo_conn->query($query);
        }
    }
276937
def maybe_clean(self):
        """"""

        now = time.time()
        if self.next_cleaning <= now:
            keys_to_delete = []
            for (k, v) in self.data.iteritems():
                if v.expiration <= now:
                    keys_to_delete.append(k)
            for k in keys_to_delete:
                del self.data[k]
            now = time.time()
            self.next_cleaning = now + self.cleaning_interval
1130020
public function onBeforeWrite() {
		parent::onBeforeWrite();
		
		// dummy initial date
		if (!$this->OriginalPublishedDate) {
			// @TODO Fix this to be correctly localized!!
			$this->OriginalPublishedDate = date('Y-m-d 12:00:00');
		}
		
		$parent = $this->Parent();

		// just in case we've been moved, update our section
		$section = $this->findSection();
		$this->NewsSectionID = $section->ID;

		$newlyCreated = $section->ID == $parent->ID;
		$changedPublishDate = $this->isChanged('OriginalPublishedDate', 2);

		if (($changedPublishDate || $newlyCreated) && ($section->AutoFiling || $section->FilingMode)) {
			if (!$this->Created) {
				$this->Created = date('Y-m-d H:i:s');
			}
			$pp = $this->PartitionParent();
			if ($pp->ID != $this->ParentID) {
				$this->ParentID = $pp->ID;
			}
		}

	}
358207
def clear_end_date(self):
        
        if (self.get_end_date_metadata().is_read_only() or
                self.get_end_date_metadata().is_required()):
            raise errors.NoAccess()
        self._my_map['endDate'] = self._mdata['end_date']['default_date_time_values'][0]