在ActiveRecord中连接时更改数据库的时区

is there any way in ActiveRecord for changing the timezone of database dynamically on the time of connection .

i am using it with codeigniter . problem is that i change the timezone in codeigniter successfully, but it don't effects on ActiveRecord queries.

thanks in advance .

Set a default Timezone(index.php)

date_default_timezone_set('America/New_York');

Set DateTime Format Manually in the Model

static $datetime_format = 'Y-m-d H:i:s';

Update, try adding this to your initialize file(im guessing you used sparks to install php-activerecord)

    //Include the ActiveRecord DateTime Class
    require_once $spark_path.'vendor/php-activerecord/lib/DateTime.php';

    //it should use your database time format, once you set it.
    ActiveRecord\DateTime::$DEFAULT_FORMAT = 'db';