function formatDate($dateStr=null,$includeTime=null){
		if($dateStr === null){
			$date = time();
		}else if(is_string($dateStr)){
			$date = strtotime($dateStr);
		}else if(is_integer($dateStr)){
			$date = $dateStr;
		}else{
			throw new InvalidInputException('1st parameter should be either a string or integer or null');
		}
		$format = "Y-m-d";
		if(isset($includeTime)){
			$format .= " H:i:s";
		}
		$mysqlDate = date($format,$date);
		return $mysqlDate;
	}