Marcellus Barrus Wed Mar 30 10:32:23 -0400 2011

Subject: How do I display DateTime?

I have a DateTime column and I want to display it.

$policies = Policies::all( array('order' => 'startcoverage' ) );
foreach( $policies as $policy ) {
echo $policy->startcoverage . "\n";

I have tried $policy->startcoverage->date as well.

What is the correct syntax. Examples within the documentation would help. Or point me to the right place within the documentation.


Marcellus Barrus Wed Mar 30 10:45:15 -0400 2011

I figured this out.

Using the example code above, I was able to display/use the date with the following line of code:

echo $policy->startcoverage->format( 'Y-m-d' );


Yoan B Fri Apr 01 02:43:53 -0400 2011