« Connect to the LSA DFS | Main | Recurring Updates to Drupal Modules »

December 18, 2012

Copy date field values with Drupal VBO

Ugly PHP snippet follows:

dpm($context);

$date1 = str_replace("T", " ", $object->field_beg_end_date[0]['value']);
dpm($date1);

$object -> field_dataset_sample_dates[0]['value'] = strtotime(str_replace("T", " ", $object->field_beg_end_date[0]['value']));
$object -> field_dataset_sample_dates[0]['value2'] = strtotime(str_replace("T", " ", $object->field_beg_end_date[0]['value2']));
node_save($object);

dpm($object);

This video gave led me to the strtotime function which shouldn't actually be used for copying to datetime fields.

VBO documentation node

Posted by kkwaiser at December 18, 2012 04:20 PM

Comments

Login to leave a comment. Create a new account.