1 2
<?php echo date('Y-m-d',strtotime('-1 second',strtotime(date('m').'/01/'.date('Y'))));
1
2012-09-30