0

I have a field collection with 2 dates (Timestamp) and would like to calculate the difference between the dates. But I can't get it to work.. Any help?

Computed code:
$eind = $entity_field->field_data_field_eind_field_collection_item_entity_type[0]'timestamp'];
$begin = $entity_field->field_data_field_begin_field_collection_item_entity_type[0]['timestamp'];
$entity_field[0]['value'] = $eind - $begin;

Display code:
$display_output = $entity_field[0]['value'];

1 Answers1

0

Missing the [ on ['timestamp']

$eind = $entity_field->field_data_field_eind_field_collection_item_entity_type[0]['timestamp']; // missing the [ here
Kenny
  • 1,543
  • 9
  • 16