Get the format as a string
<p>I have </p>

<pre><code>$now=new DateTime('now');
$dnow=$now-&gt;format('d-m-Y');

print_r("it is now ".$dnow);
</code></pre>

<p>But that results in an error of cache overflow,
I'd like to make $dnow a string to concatenate with other strings.</p>
