George Tarantilis Sun Mar 16 18:58:28 -0400 2014

Subject: Initialize Datetime to NULL ?

I'm trying to save an Activerecord object to the db.
It has a datetime field which I want to set it to NULL (ie '0000-00-00 00:00:00')

I've tried many things (NULL, null, empty datetime object), but the object is not saved, probably because the datetime object passed is invalid.

require "php_activerecord.php";
$k2_item = K2_Item::find(3);
echo "Modified time : " . $k2_item->modified . PHP_EOL;
$k2_item->modified = NULL;
$k2_item->save();

Which is the correct way of doing this?