I've some string like "11/28/2012" and i want use to populate a date field in my nodes/entity. In rules i use "set a value", select the date field and add php code:
$mydate = field_get_items(($entity_type, $entity, 'field_textdate');
$value = date('m-d-Y', $mydate);
return $value;
But when i execute the rules, i get 46.397 ms Unable to modify data "node:field-datone": Invalid data value given. Be sure it matches the required data type and format. 57.754 ms Unable to evaluate action data_set.
How can i do?