Drupal 7 - time and date field to integer and a view summary

1) I need code in PHP for drupal computed field ([login to view URL]) that would calculate difference in days between two dates e.g. :

date 1: 1st may 2019

date 2: 20 July 2020

date 2 - date 1 = circa 365 + 80 days = 445 days

and provide it as an integer value as a number of years, that I could further use for extra calculations.

445 days (calculated difference) / 365 (average year) = 1.219

that number (difference in days as a number of years) should be the output of the code.

2) some values would be provided as char or string. The code should account for it.

A draft version of the code:

$value1_energy1 = field_get_items($entity_type, $entity, 'field_energy1');

$value2_energy2 = field_get_items($entity_type, $entity, 'field_energy2');

if ($value2_energy2[0]['value'] > '0') {

$entity_field[0]['value'] = $value2_energy2[0]['value']*0.000351 + $value1_energy1 [0]['value']*0.000812;


$entity_field[0]['value'] = $value1_energy1[0]['value']*0.000812;


This is just a basic calculation and:

a) there is no date field included

b) valued1 and value2 could be provided as a string (and have a space or a comma instead of a dot).

3) those calculated values shoud be summed up in a view

There is a view with a list of nodes, and at the bottom of the view we need to provide a sum of those calculated values

example of the view with fomulas:

[login to view URL]

Kemahiran: Drupal, PHP

Lihat lagi: sample adobe form current date time form field, drupal date field content type, drupal import cck date field, drupal 7 field template, drupal 7 file field paths module, drupal 7 field encrypt, drupal 8 date field timezone, drupal 7 date time, download view module drupal 7, drupal 7 checkbox field, create view from custom table drupal 7, editable view drupal 7, drupal 7.60 release date, drupal 7 form api hidden field, drupal 7 image field, drupal 8.7 release date, view export drupal 7, drupal 7 content type field node reference, drupal 7 video embed field

Tentang Majikan:
( 0 ulasan ) Poland

ID Projek: #28380611

Dianugerahkan kepada:


I have the following experience with Drupal and PHP Experience developing web solutions in Drupal and PHP implementations in a LAMP environment. Advanced site-building experience including deep familiarity with Drupal Lagi

€190 EUR dalam 7 hari
(1 Ulasan)

8 pekerja bebas membida secara purata €192 untuk pekerjaan ini


Hello sir, I check [login to view URL] carefully and I am absolutely sure that I can do the project very well. We are enthusiastic team of developer a complete package for the successful exec Lagi

€174 EUR dalam 2 hari
(1059 Ulasan)
(92 Ulasan)

Hi, Greetings! ✅checked your project details: Drupal 7 - time and date field to integer and a view summary ✅Completed Time: In project deadline We have worked on 640 + Projects. I have 6 + years of the experien Lagi

€220 EUR dalam 4 hari
(74 Ulasan)

Hello, Warm Greetings! I have gone through your job description & I completely understand that you need a highly skilled Drupal developer with strong coding and troubleshooting skill. I am a Senior Drupal front-end Lagi

€200 EUR dalam 3 hari
(7 Ulasan)

Hello, Let's have a quick discussion to start work right away. Here a professional Drupal 7 developer with 7 years of experience and proficient in all aspects having both frontend/backend Drupal development Also, I c Lagi

€140 EUR dalam 7 hari
(10 Ulasan)

Hi there, I have read your requirements i can give you code in PHP for Durpal computed field and complete your project as all the requirement written in the bid and submit it to you in your given deadline after chat in Lagi

€140 EUR dalam 7 hari
(8 Ulasan)

Hi, Greetings! ✅checked your project details :Drupal 7 - time and date field to integer and a view summary ✅Completed Time : 24 hours or your requirement deadline . I would like to work on your project and want to be Lagi

€120 EUR dalam 2 hari
(0 Ulasan)