/*!
Sets the modification date to \a $dateTime or the current
date if it's \c false.
182265
function setModified( $dateTime = false )
    {
        if ( $dateTime === false )
        {
            $dateTime = time();
        }
        $this->Modified = $dateTime;
    }
160400
function setTimestamp( $name, $value )
    {
        $this->Timestamps[$name] = $value;
        $this->IsModified = true;
    }
679644
public function setUpdatedAtValue(\DateTime $updatedAt = null)
    {
        if($updatedAt==null && $this->updatedAt == null){
            $this->updatedAt = new \DateTime();
        }else if($updatedAt instanceof \DateTime){
            $this->updatedAt = $updatedAt;
        }else{
            $this->updatedAt = new \DateTime();
        }
    }
1085269
private function setModificationDate(array $ftpInfo)
    {
        $modDate      = !empty($ftpInfo['modify'])
                      ? DateTimeImmutable::createFromFormat('YmdHis', $ftpInfo['modify'])
                      : false;
        $this->modify = !empty($modDate) ? $modDate : new DateTimeImmutable();
    }
616554
function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement )
    {
        $operatorValue = str_replace( "\n",
                                      "<br />",
                                      $operatorValue );
    }
687956
static function setLastChecked( $id, $dateTime = false )
    {
        if ( $dateTime === false )
        {
            $dateTime = time();
        }
        eZPersistentObject::updateObjectList( array( 'definition' => eZURL::definition(),
                                                     'update_fields' => array( 'last_checked' => $dateTime ),
                                                     'conditions' => array( 'id' => $id ) ) );
    }
1155862
public function isDate() {
        $this->check_role = 'date';
        $result = false !== strtotime($this->value);
        $this->checkResult($result);
        return $this;
    }
96228
public void setDateLastModified(String dateLastModified) {

        m_hasDateLastModified = true;
        try {
            if (dateLastModified != null) {
                TimestampMode timeMode = TimestampMode.getEnum(CmsMacroResolver.stripMacro(dateLastModified));
                switch (timeMode) {
                    case FILETIME:
                        m_resourceBuilder.setDateLastModified(-1); //Can't get the information right now, must set it afterward.
                        break;
                    case IMPORTTIME:
                        m_resourceBuilder.setDateLastModified(System.currentTimeMillis());
                        break;
                    case VFSTIME:
                    default:
                        m_resourceBuilder.setDateLastModified(convertTimestamp(dateLastModified));
                        break;
                }
            } else {
                m_resourceBuilder.setDateLastModified(System.currentTimeMillis());
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }
154885
function setDay(date, day) {
		// we don't want to change month when changing date
		var month = date.getMonth(),
			diff = day - (date.getDay() || 7);
		// move to correct date
		date.setDate(date.getDate() + diff);
		// check month
		if (date.getMonth() != month) {
			if (diff > 0) {
				date.setDate(date.getDate() - 7);
			} else {
				date.setDate(date.getDate() + 7);
			}
		}
	}
720722
static function setIsValid( $id, $isValid )
    {
        $dateTime = time();
        $isValid = (int) $isValid;
        eZPersistentObject::updateObjectList( array( 'definition' => eZURL::definition(),
                                                     'update_fields' => array( 'is_valid' => $isValid,
                                                                               'modified' => $dateTime ),
                                                     'conditions' => array( 'id' => $id ) ) );
    }
900948
protected function setUpdatedAt()
    {
        // Convert created_at back to GMT for saving
        if (isset($this->created_at)) {
            $this->created_at = Time::localToGmt($this->created_at);
        }

        // Set updated at
        if (!isset($this->updated_at) or $this->updated_at === null) {
            $this->updated_at = 'NOW()';
        }
    }
1189151
public function setLastModified(\DateTime $date = null): self
    {
        if (null === $date) {
            $this->header->remove('Last-Modified');
        } else {
            $date = clone $date;
            $date->setTimezone(new \DateTimeZone('UTC'));
            $this->header->set('Last-Modified', $date->format('D, d M Y H:i:s') . ' GMT');
        }

        return $this;
    }
644480
public function setModificationDate($modificationDate = null)
    {
        if (!isset($modificationDate)) {
            $modificationDate = new \DateTime();
        }
        if (is_string($modificationDate)) {
            $modificationDate = new \DateTime($modificationDate);
        }
        $this->modificationDate = $modificationDate;
        return $this;
    }
889941
public function modify($change)
    {
        $date = clone $this;
        $date->setDate(strtotime($change, $this->getDate(DATE_FORMAT_UNIXTIME)));

        return $date;
    }
1372403
public function registerModificationDate($date)
    {
        $timestamp = is_numeric($date) ? $date : strtotime($date);
        if ($timestamp > $this->modificationDate) {
            $this->modificationDate = $timestamp;
        }
        return $this;
    }
980846
public void setModified(DateTime date) throws InvalidArgumentException {
    if (date == null) {
      throw new InvalidArgumentException("Date cannot be empty");
    }
    copyConditions.put("x-amz-copy-source-if-modified-since", date.toString(DateFormat.HTTP_HEADER_DATE_FORMAT));
  }
75615
public static function modifyDate($date, array $params = [])
    {
        if (empty($date)) {
            return null;
        }
        $params['config'] = Helper::getValue($params['config'], []);
        if (!empty($params['locale'])) {
            $params['config']['locale'] = $params['locale'];
        }
        $dateTime = DateTime::set($date, null, $params['config']);
        if (isset($params['timezone'])) {
            $dateTime->convertTimezone($params['timezone']);
        }
        return $dateTime->format(Helper::getValue($params['format']));
    }