src/Utility/Time.php
public static function parseLocalDate($date, array $allowed = ['.', '-']) {
		$datePieces = explode(' ', $date, 2);
		$date = array_shift($datePieces);

		if (strpos($date, '.') !== false) {
			$pieces = explode('.', $date);
			$year = $pieces[2];
			if (strlen($year) === 2) {
				if ($year < 50) {
					$year = '20' . $year;
				} else {
					$year = '19' . $year;
				}
			}
			$date = mktime(0, 0, 0, $pieces[1], $pieces[0], $year);
		} elseif (strpos($date, '-') !== false) {
			//$pieces = explode('-', $date);
			$date = strtotime($date);
		} else {
			return 0;
		}
		return $date;
	}
public static function parseLocalDate($date, array $allowed = ['.', '-']) {
		$datePieces = explode(' ', $date, 2);
		$date = array_shift($datePieces);

		if (strpos($date, '.') !== false) {
			$pieces = explode('.', $date);
			$year = $pieces[2];
			if (strlen($year) === 2) {
				if ($year < 50) {
					$year = '20' . $year;
				} else {
					$year = '19' . $year;
				}
			}
			$date = mktime(0, 0, 0, $pieces[1], $pieces[0], $year);
		} elseif (strpos($date, '-') !== false) {
			//$pieces = explode('-', $date);
			$date = strtotime($date);
		} else {
			return 0;
		}
		return $date;
	}
public static function parseLocalDate ( $ date , array $ allowed = [ '.' , '-' ] ) { $ datePieces = explode ( ' ' , $ date , 2 ) ; $ date = array_shift ( $ datePieces ) ; if ( strpos ( $ date , '.' ) !== false ) { $ pieces = explode ( '.' , $ date ) ; $ year = $ pieces [ 2 ] ; if ( strlen ( $ year ) === 2 ) { if ( $ year < 50 ) { $ year = '20' . $ year ; } else { $ year = '19' . $ year ; } } $ date = mktime ( 0 , 0 , 0 , $ pieces [ 1 ] , $ pieces [ 0 ] , $ year ) ; } elseif ( strpos ( $ date , '-' ) !== false ) { //$pieces = explode('-', $date); $ date = strtotime ( $ date ) ; } else { return 0 ; } return $ date ; }
Parse 2022-11-12 or 12.11.2022 or even 12.11.22

@param string $date
@param array $allowed
@return int Seconds
Parse 2022 - 11 - 12 or 12 . 11 . 2022 or even 12 . 11 . 22