 <p>Fixed it using some of the suggestions below.</p> <pre><code>$startDate = new DateTime(date("2012-4-1")); $endDate = new DateTime(date("Y-m-t", strtotime($startDate-&gt;format("Y-m-d")))); echo "The start date should be 2012-4-1: " . $startDate-&gt;format("Y-m-d") . "&lt;br /&gt;"; echo "The end date should be 2012-4-30: " . $endDate-&gt;format("Y-m-d") . "&lt;br /&gt;"; </code></pre> <p>I've verified that this works.</p>