0

我有一个包含 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'];
4

1 回答 1

0

缺少[['timestamp']

$eind = $entity_field->field_data_field_eind_field_collection_item_entity_type[0]['timestamp']; // missing the [ here
于 2013-11-28T21:09:41.137 回答