# Extra field in Project module to calculate the days diff between the start and ending dates

**URL:** <https://www.dolibarr.org/forum/t/extra-field-in-project-module-to-calculate-the-days-diff-between-the-start-and-ending-dates/24872>\
**Category:** Other native modules\
**Created:** [January 24, 2024, 12:20am UTC](https://www.dolibarr.org/forum/t/extra-field-in-project-module-to-calculate-the-days-diff-between-the-start-and-ending-dates/24872 "2024-01-24T00:20:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![garciave](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/eb8c5e/32.png) [@garciave](https://www.dolibarr.org/forum/u/garciave)\
**Post date:** [January 24, 2024, 12:20am UTC](https://www.dolibarr.org/forum/t/extra-field-in-project-module-to-calculate-the-days-diff-between-the-start-and-ending-dates/24872/1 "2024-01-24T00:20:31Z")

</div>

Hi all, I am really looking for help on working with computed extra fields.

I am simply trying to have an extra field that will show in the card and in the lists the time spent in days between the start and the end of a project.  
I was trying to use PHP DateTime class but never got any result. Assuming that an empty response is indicating an error, I could not find any record in the log indicating what this issue was.

If any could give me a light on how to achieve this, I would highly appreciate it.

Regards

---

<div class="post-metadata">

**Author:** ![garciave](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/eb8c5e/32.png) [@garciave](https://www.dolibarr.org/forum/u/garciave)\
**Post date:** [January 24, 2024, 3:10pm UTC](https://www.dolibarr.org/forum/t/extra-field-in-project-module-to-calculate-the-days-diff-between-the-start-and-ending-dates/24872/2 "2024-01-24T15:10:38Z")

</div>

Pls forget about it, I was using the wrong field names. It’s working as expected. Tks

---

<div class="post-metadata">

**Author:** ![garciave](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/eb8c5e/32.png) [@garciave](https://www.dolibarr.org/forum/u/garciave)\
**Post date:** [January 24, 2024, 3:11pm UTC](https://www.dolibarr.org/forum/t/extra-field-in-project-module-to-calculate-the-days-diff-between-the-start-and-ending-dates/24872/3 "2024-01-24T15:11:35Z")

</div>

BTW, for the help of others, the field names are all defined in the class.php file of each module. You need to look inside to find them out.
