Gleb Esman Thu Oct 13 17:20:43 -0400 2011

Subject: Any DATETIME column is invalidated

Hello,
Whenever my model includes 'created_at' (DATETIME) column - $my_record->save() call blows up with:
"Incorrect datetime value: '2011-10-13 17:08:00 EDT' for column 'created_at'. PHP AR somehow forces timezone (EDT in my case) into any DATETIME column and I haven't find a way to fix it.

Is there a way to make PHP AR to NOT override my value or at least not to insert timezone part of it?

Gleb


Gleb Esman Thu Oct 13 18:24:17 -0400 2011

Also the cuplprit is here:
https://github.com/kla/php-activerecord/blob/master/lib/Connection.php#L452

It supposed to "Return a date time formatted into the database's datetime format.". But looks like database DATETIME format suppose to be 'Y-m-d H:i:s", and NOT 'Y-m-d H:i:s T".

Any ideas how to solve it without hardcoding it in Connection.php ?

(1-1/1)