This is my second question about my issues with creating custom migration script.
I am creating only new nodes and don't care about updates.
Code:
$node = new stdClass();
$node->type = 'migrate';
$node->title = $content['title'];
$node->language = LANGUAGE_NONE;
$node->created = (int) date('U',strtotime($content['created']));
$modified = $content['modified'];
if (! empty($modified) && $modified != '0000-00-00 00:00:00') {
$modified = (int) date('U',strtotime($modified));
} else {
$modified = 0;
}
$node->changed = $modified;
node_object_prepare($node);
#some lines later
node_save($node);
E.g my $modified is set to 0 and after save I see updated column of this node row in admin content list with current datetime value.