How to set a datetime field to NULL?

Is it possible to set a datetime field to null?

I have a custom field called ‘date_bought_c’ that stores the datetime a product was bought. However, there are scenarios when this field needs to be reset, like when it turns out someone set this field incorrectly.

I have tried the following:


$bean->date_bought_c = '';
$bean->date_bought_c = 0;
$bean->date_bought_c = 'NULL';
$bean->date_bought_c = 'null';
$bean->date_bought_c = NULL;
$bean->date_bought_c = null;
$bean->date_bought_c = "''";

Although my code works with the first example, it still writes the following log:

[ERROR] Field date_bought_c expecting datetime format, but got value:

These errors are generated every time someone saves a Lead. There are multiple datetime fields so there are several per save. These lines in my log file are cluttering up the log. I’m in the process of cleaning my log up and would like to get rid of these errors.

Is there a proper way to set a datetime field to null? Is it possible?

Thanks for any help!