src/Core/TypeManager.php
protected function valueToDatetime ($fmt, $value)
    {
        // ISO format YYYY-MM-DD HH:MM:SS as input
        if ($value == "0000-00-00 00:00:00") {
            return "";
        }
        if ($fmt == null) {
            $fmt = DATETIME_FORMAT;
        }
        return $this->valueToDate($fmt, $value);
    }
protected function valueToDatetime ($fmt, $value)
    {
        // ISO format YYYY-MM-DD HH:MM:SS as input
        if ($value == "0000-00-00 00:00:00") {
            return "";
        }
        if ($fmt == null) {
            $fmt = DATETIME_FORMAT;
        }
        return $this->valueToDate($fmt, $value);
    }
Format value to date time

@param string $fmt - type format
@param string $value - value
@return string - formatted string