Subject: Dealing with the DateTime object
I've been referring to http://www.phpactiverecord.org/docs/ActiveRecord/DateTime
But when trying the example given in that page,
$now = new ActiveRecord\DateTime('2010-01-02 03:04:05'); ActiveRecord \ DateTime :: $DEFAULT_FORMAT = 'short';
I get the following error: Fatal error: Access to undeclared static property: ActiveRecord\DateTime::$DEFAULT_FORMAT
What am I missing?
What I'm ultimately looking to do is set the default format for the datetime columns in my model. I'm using the v1.0 stable build.
The docs that you mention are generated from the nightly build, $DEFAULT_FORMAT didn't exist yet at v1.0.
(1-1/1)
June 27 2010
April 16, 2013
Subject: Dealing with the DateTime object
I've been referring to http://www.phpactiverecord.org/docs/ActiveRecord/DateTime
But when trying the example given in that page,
$now = new ActiveRecord\DateTime('2010-01-02 03:04:05');
ActiveRecord \ DateTime :: $DEFAULT_FORMAT = 'short';
I get the following error:
Fatal error: Access to undeclared static property: ActiveRecord\DateTime::$DEFAULT_FORMAT
What am I missing?
What I'm ultimately looking to do is set the default format for the datetime columns in my model. I'm using the v1.0 stable build.