I am using DateTime construcor to construct date but it is not parsing, mine code is following
$current=$timeDate->nowDate();
//$timeDate->nowDate() is sugarCRM function returns date and in next line i fetched variables $y, $m, $d successfully
list($y, $m, $d) = explode("/", $current);
$expiredate = new DateTime($y.'-'.$m.'-'.$d);
following error caught in exception
DateTime::__construct() [datetime.--construct]: Failed to parse time string (08-30-2012) at position 0 (0): Unexpected character
The order of the variables ($y, $m, $d) seems to be off, you should write