<?php
$format = "Y-m-d"
$time = ""
$timezone = null
if(!$timezone) $timezone = new DateTimeZone(date_default_timezone_get());
//Dont use version. This will mess with the tests
/*$version = explode('.', phpversion());
if(((int)$version[0] >= 5 && (int)$version[1] >= 2 && (int)$version[2] > 17)){
return parent::createFromFormat($format, $time, $timezone);
}*/
$unixTimestamp = strtotime($time);
//Return false if there is it is an invalid time
/*if($unixTimestamp == false)
{
return false;
}*/
return new DateTime(date($format, $unixTimestamp), $timezone);