Retourne la date suivant le $format

@param string $format (default:'DD/MM/YYYY')

@return false|string
437191
public function format($format = '%d/%m/%Y')
    {
        if ($this->time == null) {
            return false;
        }
        
        return strftime($format, $this->time);
    }
962685
public function setFormat($format)
    {
        $result = true;
        if (($this->debug === true) && !empty($this->evidence) && isset(Formats::$$this->evidence)) {
            if (array_key_exists($format, array_flip(Formats::$$this->evidence))
                === false) {
                $result = false;
            }
        }
        if ($result === true) {
            $this->format = $format;
            $this->updateApiURL();
        }
        return $result;
    }
840655
static public function udate($format)
	{
		$utimestamp = microtime(true);

		$usec = round(1000 * 1000 * ($utimestamp - floor($utimestamp)));

		return date(str_replace('u', $usec, $format), $utimestamp);
	}
1355491
public static function datetime($value, $format = 'Y-m-d H:i:s')
    {
        if (empty($value)) {
            return null;    
        }
        
        $datetime = new \DateTime($value);

        return $datetime->format($format);
    }
1273811
public function format($format = null) {
        if(is_null($format)) {
            $format = $this->getFormatter()->getCurrentFormat();
        }
        return date($format, $this->getEpoch());
    }
300647
public static function convertToDatetime($rawDate, $format = 'd.m.Y')
    {
        // convert timestamp to date format
        if (Any::isInt($rawDate)) {
            $rawDate = date(\DateTime::ATOM, $rawDate);
        }

        try {
            $object = new \DateTime($rawDate);
            return $object->format($format);
        } catch (\Exception $e) {
            return false;
        }
    }
1081150
public static function valid(string $date, string $format): bool {
        return date($format, strtotime($date)) === $date;

    }
92525
public function getAsDate($column, $format = null, $default = false)
  {
    $v = $this->get($column, $default);

    return $v ? new DateTime($v, null, $format) : $default;
  }
1014072
public function setFormat($format = null)
    {
        if ( ! is_null($format)) {
            self::checkFormat($format);
            $this->format = $format;
        }

        return $this;
    }
1222286
public function prettyDate($date, $format = null)
    {
        if (is_string($date)) {
            $date = new \DateTime($date);
        }

        if (null !== $format) {
            return $this->dateFormatter->prettyDate($date, $format);
        }

        return $this->dateFormatter->prettyDate($date);
    }
929128
public function dateFormat($date, $format = '%e %b %Y')
    {
        if ($date instanceof \DateTime) {
            $ts = $date->getTimestamp();
        } elseif (is_numeric($date)) {
            $ts = $date;
        } elseif (preg_match('/^[0-9]{4,4}-[0-9]{2,2}-[0-9]{2,2}T[0-9]{2,2}:[0-9]{2,2}.*/', $date)) {
            // timestamp format 2013-01-01T00:00:00
            $ts = new \DateTime($date);
            $ts = $ts->getTimestamp();
        } else {
            throw new \InvalidArgumentException(sprintf("Cannot format %s as a date", $date));
        }

        return strftime($format, $ts);
    }
1293574
public static function isDate($input = false, $format = 'Y-m-d H:i:s') {

        if ($input && Date::isDate($input)) {

            return true;
        }

        return false;
    }
234796
protected function convertDateFormatToMoment($format)
    {
        $replacements = [
            'd' => 'DD',
            'D' => 'ddd',
            'j' => 'D',
            'l' => 'dddd',
            'N' => 'E',
            'S' => 'o',
            'w' => 'e',
            'z' => 'DDD',
            'W' => 'W',
            'F' => 'MMMM',
            'm' => 'MM',
            'M' => 'MMM',
            'n' => 'M',
            't' => '', // no equivalent
            'L' => '', // no equivalent
            'o' => 'YYYY',
            'Y' => 'YYYY',
            'y' => 'YY',
            'a' => 'a',
            'A' => 'A',
            'B' => '', // no equivalent
            'g' => 'h',
            'G' => 'H',
            'h' => 'hh',
            'H' => 'HH',
            'i' => 'mm',
            's' => 'ss',
            'u' => 'SSS',
            'e' => 'zz', // deprecated since version 1.6.0 of moment.js
            'I' => '', // no equivalent
            'O' => '', // no equivalent
            'P' => '', // no equivalent
            'T' => '', // no equivalent
            'Z' => '', // no equivalent
            'c' => '', // no equivalent
            'r' => '', // no equivalent
            'U' => 'X',
        ];

        foreach ($replacements as $from => $to) {
            $replacements['\\' . $from] = '[' . $from . ']';
        }

        return strtr($format, $replacements);
    }
18972
public function date($key, $format = "F j, Y")
    {
        if (is_numeric($this->_params[$key])) {
            return date($format, $this->_params[$key]);
        }

        return date($format, strtotime($this->_params[$key]));
    }
317199
public static function getDatePlaceholder(string $format) : string {
		$format = str_replace('Y', 'YYYY', $format);
		$format = str_replace('m', 'MM', $format);
		$format = str_replace('d', 'DD', $format);
		$format = str_replace('H', 'HH', $format);
		$format = str_replace('i', 'MM', $format);
		$format = str_replace('s', 'SS', $format);
		$format = str_replace('g', 'HH', $format);
		$format = str_replace('a', 'am', $format);
		$format = str_replace('u', '000000', $format);
		return $format;
	}
1079042
public static function valid_date($date = null, $format = 'DD/MM/YYYY')
    {
        if ($date == null) {
            return false;
        }
        $lendate = strlen($date);
        if ($lendate > 10) {
            $date = substr($date, 0, 10);
            $lendate = strlen($date);
        }
        
        if ($lendate >= 8 && $lendate <= 10) {
            $regexp = $format;
            $regexp = str_replace('DD', '(?<D>\d{2})', $regexp);
            $regexp = str_replace('MM', '(?<M>\d{2})', $regexp);
            $regexp = str_replace('YYYY', '(?<Y>\d{4})', $regexp);
            
            if (preg_match("/$regexp/", $date, $aDate)) {
                $year = ($aDate['Y'] < 100) ? 2000 + $aDate['Y'] : $aDate['Y'];
                $month = $aDate['M'];
                $day = $aDate['D'];
                
                if (self::checkdate($month, $day, $year)) {
                    return mktime(0, 0, 0, $month, $day, $year);
                }
                else {
                    return false;
                }
            }
            else {
                return false;
            }
        }
        else {
            return false;
        }
    }
1310567
public static function date($input = null, $format = 'MM/DD/YYYY')
	{
		if (empty($input)) {
			return true;
		}

		switch($format) {
			case 'YYYY/MM/DD':
			case 'YYYY-MM-DD':
			list($y, $m, $d) = preg_split('/[-\.\/ ]/', $input);
			break;

			case 'YYYY/DD/MM':
			case 'YYYY-DD-MM':
			list($y, $d, $m) = preg_split('/[-\.\/ ]/', $input);
			break;

			case 'DD-MM-YYYY':
			case 'DD/MM/YYYY':
			list($d, $m, $y) = preg_split('/[-\.\/ ]/', $input);
			break;

			case 'MM-DD-YYYY':
			case 'MM/DD/YYYY':
			list($m, $d, $y) = preg_split('/[-\.\/ ]/', $input);
			break;

			case 'YYYYMMDD':
			$y = substr($input, 0, 4);
			$m = substr($input, 4, 2);
			$d = substr($input, 6, 2);
			break;

			case 'YYYYDDMM':
			$y = substr($input, 0, 4);
			$d = substr($input, 4, 2);
			$m = substr($input, 6, 2);
			break;

			default:
			throw new \InvalidArgumentException("Invalid Date Format");
		}
		return checkdate($m, $d, $y);
	}