Set the date-time of the Date in this Header.

If a DateTime instance is provided, it is converted to DateTimeImmutable.
350519
public function setDateTime(DateTimeInterface $dateTime)
    {
        $this->clearCachedValueIf($this->getCachedValue() != $dateTime->format(DateTime::RFC2822));
        if ($dateTime instanceof DateTime) {
            $immutable = new DateTimeImmutable('@'.$dateTime->getTimestamp());
            $dateTime = $immutable->setTimezone($dateTime->getTimezone());
        }
        $this->dateTime = $dateTime;
    }
711113
def __set_date(self, value):
        '''
        
        '''
        value = date_to_datetime(value)
        if value > datetime.now() + timedelta(hours=14, minutes=1): #More or less 14 hours from now in case the submitted date was local
            raise ValueError("Date cannot be in the future.")

        if self.__due_date and value.date() > self.__due_date:
            raise ValueError("Date cannot be posterior to the due date.")

        self.__date = value
809441
public void setDateReleased(String dateReleased) {

        try {
            if (dateReleased != null) {
                m_resourceBuilder.setDateReleased(convertTimestamp(dateReleased));
            } else {
                m_resourceBuilder.setDateReleased(CmsResource.DATE_RELEASED_DEFAULT);
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }
1279599
def getDate(self):
        ""
        date = self.headers.get('date')
        if date:
            date = self.convertTimeString(date)
        return date
1178490
public void setCreationTime(com.google.api.ads.admanager.axis.v201805.DateTime creationTime) {
        this.creationTime = creationTime;
    }
1114229
function(x) {
			if(this.time instanceof Date) {
				this.time.setSeconds(this.time.getSeconds() + x);
			}
			else {
				this.time += x;
			}
		}
1343265
public Date setStartDate(Date time)
    {
        try   {
            this.getTable().edit();
            this.getField("StartDateTime").setData(time);
            this.getTable().set(this);
            this.getTable().seek(null);    // Read this record
        } catch (Exception ex)  {
            ex.printStackTrace();
        }
        return this.getStartDate();
    }
891128
def on_dt_changed(self, dt):
        
        self.datetime = dt
        self.blotter.set_date(dt)
448033
def set_day(self, day: int) -> datetime:
        
        self.value = self.value.replace(day=day)
        return self.value
976297
def set(self, instance, value, **kw):
        
        if value:
            try:
                value = DateTime(value)
            except SyntaxError:
                logger.warn("Value '{}' is not a valid DateTime string"
                            .format(value))
                return False

        self._set(instance, value, **kw)
1042638
def set!(date)
      date = Date.parse date if date.is_a?(String)

      message = "DateField##{__callee__} only accepts instances of Date or Time"
      raise ArgumentError, message unless [Date, ::Time].include?(date.class)

      date_string = date.strftime('%Y-%m-%d')
      element_call(:wait_for_writable) { execute_js(:setValue, @element, date_string) }
    end
964706
def setStartdatetime(self, recording_start_time):
        
        if isinstance(recording_start_time,datetime):
            self.recording_start_time = recording_start_time
        else:
            self.recording_start_time = datetime.strptime(recording_start_time,"%d %b %Y %H:%M:%S")
        self.update_header()
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;
    }
447768
public void setValue(Date value, boolean hasTime) {
		setValue((value == null) ? null : new ICalDate(value, hasTime));
	}
1247210
public function setDate(\DateTime $date): self
    {
        $date->setTimezone(new \DateTimeZone('UTC'));
        $this->header->set('Date', $date->format('D, d M Y H:i:s') . ' GMT');

        return $this;
    }
575104
def begin_date(self, value):
        

        if not isinstance(value, datetime):
            raise TypeError(_pretty_message(
                '''
                begin_date must be an instance of datetime.datetime, not %s
                ''',
                _type_name(value)
            ))

        self._begin_date = value
924983
public void setDateCreated(String dateCreated) {

        try {
            if (dateCreated != null) {
                m_resourceBuilder.setDateCreated(convertTimestamp(dateCreated));
            } else {
                m_resourceBuilder.setDateCreated(System.currentTimeMillis());
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }