How can I programmatically insert date field values? I have a bunch of values from a .sql export that are in the datetime format (same format that date fields take in the DB). I'm creating nodes using these date values. How can I insert these values into the date field?

I tried:

$node-&gt;field_data_field_date['und'][0]['field_date_value'] = $datetime_value;


but it didn't seem to work. Any ideas? Thanks!
If your field's name is field_date you should access it by using 

$node-&gt;field_date['und'][0]['value'] = $datetime_value;


And if it has an "end" date you have to set its value2 property.

Try to install devel, create a node for the content type you want to use and go to the devel tab node/123/devel to explore its object.