$field_name; if (!is_array($feed_element)) { // TODO TIMEZONE // Don't know what type of date so first attempt to create a date from a string $date = date_text_make_dbdate($feed_element, $field['type'], '', 'none', date_granularity_array($field)); if ($date->db->timestamp == '') { // not from string, use the empty date object and try as a datestamp date_set_date($date, $feed_element, 'none', 'db', DATE_UNIX); // Note granularity is also done on submit } } if ($field['type'] == DATE_ISO) { $items[]['value'] = $date->db->iso; } else { $items[]['value'] = $date->db->timestamp; } $node->$field_name = $items; return $node; } }