我有一个包含2个日期(时间戳)的字段集合,并希望计算日期之间的差异。但我无法让它发挥作用..有任何帮助吗?
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'];
答案 0 :(得分:0)
错过[
['timestamp']
$eind = $entity_field->field_data_field_eind_field_collection_item_entity_type[0]['timestamp']; // missing the [ here