The date and time of contact-object creation.

@param string|null $format format of the date string

@return \DateTime|string
422387
public function getCreateDate($format = null)
    {
        $node = $this->getFirst('//epp:epp/epp:response/epp:resData/contact:creData/contact:crDate');
        if ($format === null) {
            return $node->nodeValue;
        }

        return date_create_from_format($format, $node->nodeValue);
    }
1319715
public function format($format = null)
    {
        $format ?: $format = $this->format;

        return strtr($format, $this->getFormattedReplacements());
    }
283977
public function getDateSunday($format = 'Y-m-d')
    {
        $weekDay = 7 - $this->format('N');
        $time = $this->getTimestamp();
        if ($weekDay) {
            $time += $weekDay * 24 * 3600;
        }
        return date($format, $time);
    }
516750
public function now($format = null)
    {
        $date = $this->currentDate
            ? clone $this->currentDate
            : ($this->currentDate = new \DateTime())
        ;

        return empty($format) ?
            $date :
            $date->format($format)
        ;
    }
382993
public function getCreatedDateString($format = \DateTime::ISO8601)
    {
        $date = $this->getCreatedDate();

        if (empty($date)) {
            return null;
        }

        return $date->format($format);
    }
511482
protected function inputDate( $date, $format = null )
    {
        if ( ! $date instanceof DateTime )
        {
            if ( $date instanceof BaseDateTime )
            {
                $date = DateTime::createFromFormat(
                    DateTime::ISO8601,
                    $date->format( DateTime::ISO8601 )
                );
            }

            if ( is_int( $date ) )
            {
                $date = new DateTime( '@' . $date );
            }
            else if ( empty( $format ) )
            {
                $date = new DateTime( $date );
            }
            else
            {
                $date = DateTime::createFromFormat( $format, $date );
            }
        }

        return $date;
    }
1105914
static public function datetime($value=null, $format=null)
    {
        $value = static::toUnixtime($value);
        if (!$format) {
            $value = strftime('%Y-%m-%d %H:%M:%S', $value);
        } else {
            if (strpos($format, '%') === false) {
                $format = preg_replace('/([a-z])/i', '%\\1', $format);
            }
            $value = strftime($format, $value);
        }
        return $value;
    }
551917
public function dateFormat($date, string $format = 'M d Y'): string
    {
        if ($date instanceof DateTime) {
            return $date->format($format);
        } elseif (is_int($date)) {
            return date($format, $date);
        }

        return date($format, strtotime($date));
    }
1075641
public function getTime($format = null)
    {
        //argument 1 must be a string or null
        Argument::i()->test(1, 'string', 'null');

        $time = $this->time + $this->offset;

        if (!is_null($format)) {
            return date($format, $time);
        }

        return $time;
    }
1279646
public function dateTime(string $format = DateTime::DISPLAY_FORMAT) : DateTimeFieldBuilder
    {
        return new DateTimeFieldBuilder($this->field->type(new DateTimeType($format)));
    }
469972
public function date(string $format = Date::DISPLAY_FORMAT) : DateFieldBuilder
    {
        return new DateFieldBuilder($this->field->type(new DateType($format)));
    }
1014072
public function setFormat($format = null)
    {
        if ( ! is_null($format)) {
            self::checkFormat($format);
            $this->format = $format;
        }

        return $this;
    }
717374
public function date($date, $format = null)
    {
        if ($this->isEmptyDate($date)) {
            return '';
        }

        $isLocalizerFormat = in_array($format, [Localizer::SHORT, Localizer::LONG, Localizer::VERBOSE]);

        if ($format && !$isLocalizerFormat) {
            return $this->toDateTime($date)->format($format);
        }

        if (!$this->localizer) {
            return $this->toDateTime($date)->format('Y-m-d');
        }

        return $this->localizer->date($date, $format ?: Localizer::SHORT);
    }
702622
private function formatDate(\DateTime $datetime = null, $format = 'Y_m_d')
    {
        if (null == $datetime) {
            $datetime = new \DateTime('now');
        }

        return $datetime->format($format);
    }
1198926
public static function time(string $time = 'now', string $format = null): \DateTimeInterface {
        $timezone = new \DateTimeZone('utc');

        if (is_null($format)) {
            $date = new \DateTime($time, $timezone);
        } else {
            $date = \DateTime::createFromFormat($format, $time, $timezone);
        }

        return $date;
    }
323899
public function getDate($date = null, $format = 'Y-m-d H:i:s')
    {
        if (strlen($date) < 0) {
            $date = date('d-m-Y H:i:s');
        }

        $timeStamp = new DateTime($date);
        return $timeStamp->format($format);
    }
65817
public function getCreatedAt($format = null, $timezone = null)
    {
        return $this->getDisplayDateTime($this->created_at, $format, $timezone);
    }