Created
October 22, 2015 11:45
-
-
Save morad7/c821f40647dfd4b56a9c to your computer and use it in GitHub Desktop.
Drupal: calculate date differnece using views php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$date_start = new DateTime($data->field_field_date_conge[0]['raw']['value']); | |
$date_end = new DateTime($data->field_field_date_conge[0]['raw']['value2']); | |
$diff=date_diff($date_start,$date_end); | |
echo $diff->format("%a jours"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment