Set date time when was the project created.

@param DateTime|string $val Date time of creation.
@return \odTimeTracker\Model\ProjectEntity
504928
public function setCreated($val)
	{
		if (($val instanceof \DateTime)) {
			$this->created = $val;
		}
		else if (is_string($val) && !empty($val)) {
			try {
				// There can be accidentaly exeption thrown whenever the given
				// string is not valid date.
				$this->created = new \DateTime($val);
			} catch(\Exception $e) {
				$this->created = null;
			}
		}
		else {
			$this->created = null;
		}

		return $this;
	}
254193
public static function create(float $timestamp = null): \DateTime
    {
        $date = static::format($timestamp);
        return new \DateTime($date);
    }
1297454
public function set($name, $val)
    {
        $var = &$this->nestedValueRef($name, $this->data);

        // Mark changed
        if ($var !== $val) {
            $var = $val;
            $this->markChanged($name);
        }
        return $this;
    }
219747
public function storageVal($val)
    {
        $val = $this->dateTimeVal($val);

        if ($val instanceof DateTimeInterface) {
            return $val->format('Y-m-d H:i:s');
        } else {
            if ($this->allowNull()) {
                return null;
            } else {
                throw new Exception(
                    'Invalid date/time value. Must be a DateTimeInterface instance.'
                );
            }
        }
    }
671733
public static function isISODate($val)
    {
        if(!is_string($val)) {
            return false;
        }

        // Use DateTime support to check for valid dates.
        try
        {
            $date = new DateTime($val);
        }
        catch(Exception $e)
        {
            return false;
        }

        return true;
    }
920069
public function setCreatedAt($created_at) {

        $this -> created_at = $created_at !== null ? new \DateTime($created_at) : null;
        return $this;
    }
1264964
protected function setTime($time) {

        if ($time === null) {
            $time = 0;
        }

        $this->time = new \DateTime('@' . $time);
        return $this;

    }
1015103
public function getFilterValue($val)
    {
        $formatter = new IntlDateFormatter(
            $this->getLocale(),
            $this->getOutputDateType(),
            $this->getOutputTimeType(),
            $this->getOutputTimezone(),
            IntlDateFormatter::GREGORIAN,
            $this->getOutputPattern()
        );
        $timestamp = $formatter->parse($val);

        $date = new PhpDateTime();
        $date->setTimestamp($timestamp);
        $date->setTimezone(new DateTimeZone($this->getSourceTimezone()));

        return $date->format($this->getSourceDateTimeFormat());
    }
409677
public function withEvaluationTime(\DateTimeImmutable $dt): self
    {
        $obj = clone $this;
        $obj->_evalTime = $dt;
        return $obj;
    }
588720
public static function castToDateTime($value)
    {
        if ($value instanceof \DateTime) {
            return clone $value;
        }
        if (is_numeric($value)) {
            $date = new \DateTime();
            $date->setTimestamp((int)$value);
        } elseif (is_string($value) || (is_object($value) && method_exists($value, '__toString'))) {
            $date = date_create((string)$value);
            if ($date === false) {
                $date = null;
            }
        } else {
            $date = null;
        }
        return $date;
    }
32414
public function setCreatedAtDateTime(?DateTime $createdAt)
    {
        $this->created_at = $createdAt === null ? null : $createdAt->format('Y-m-d H:i:s');
        return $this;
    }
1004686
public function initDatetimeObject($datetimeOrTimestamp = null, $inputTimezone = null, $outputTimezone = null) {
		if(!$inputTimezone) {
			$inputTimezone = $this->serverTimezone;
		}
		if(!$outputTimezone) {
			$outputTimezone = $this->clientTimezone;
		}

		if(strlen($datetimeOrTimestamp) == 10) {
			$isTimeStamp = is_numeric($datetimeOrTimestamp);
			$isDate = !$isTimeStamp;
		}
		else {
			$isTimeStamp = false;
			$isDate = false;
		}

		if($isTimeStamp) {
			$datetime = new \DateTime();
			$datetime->setTimestamp($datetimeOrTimestamp);
		}
		else {
			$datetime = new \DateTime($datetimeOrTimestamp, $inputTimezone ? $this->getTimezoneObject($inputTimezone) : null);
		}

		if(!$isDate && $outputTimezone && $outputTimezone != $inputTimezone) {
			$datetime->setTimezone($this->getTimezoneObject($outputTimezone));
		}
		return $datetime;
	}
885975
public function getUserValue($val)
    {
        if ('' == $val) {
            return '';
        }

        if ($val instanceof PhpDateTime) {
            $date = $val;
            $date->setTimezone(new DateTimeZone($this->getSourceTimezone()));
            $date->setTimezone(new DateTimeZone($this->getOutputTimezone()));
        } else {
            $date = PhpDateTime::createFromFormat(
                $this->getSourceDateTimeFormat(),
                $val,
                new DateTimeZone($this->getSourceTimezone())
            );
            if (false === $date) {
                return '';
            }
            $date->setTimezone(new DateTimeZone($this->getOutputTimezone()));
        }
        $formatter = new IntlDateFormatter(
            $this->getLocale(),
            $this->getOutputDateType(),
            $this->getOutputTimeType(),
            $this->getOutputTimezone(),
            IntlDateFormatter::GREGORIAN,
            $this->getOutputPattern()
        );

        return $formatter->format($date->getTimestamp());
    }
165930
public function val($value = null)
    {
        if (!$this->isNull($value)) {
            $this->value = $value;

            return $this;
        }

        return $this->getDateObject()->format($this->format);
    }
720277
protected function setGenesisStatusDate($val)
    {
        $val = $this->cleanDateTimeValue($val);
        $this->validateReadOnly('genesisStatusDate', $val);
        return $this->_setAttribute('genesisStatusDate', $val);
    }
665851
public function schedule($when)
    {
        if (is_numeric($when)) {
            $dt = new DateTime;
            $dt->setTimestamp($when);
        } else {
            $dt = new DateTime($when);
        }

        $this->scheduled_at = $dt->format(DateTime::ISO8601);

        return $this;
    }
612428
public function setDateFromDateTime(DateTime $date = NULL, DateTimeZone $dateTimeZone = NULL) {
    $dateTimeZone = !empty($dateTimeZone) ? $dateTimeZone : new DateTimeZone('UTC');
    $this->date = !empty($date) ? $date : new DateTime($date);
    $this->date->setTimezone($dateTimeZone);
  }