Hi,
I used below method to calculate days between 2 date fields. I need to calculate and get days/hours/minutes for a field and it should show as Eg - 2 days 10 hour 30 minutes or like any easy way. Is it possible ?
$durationMinutes = (datetime\format(EndDate, 'UTC', 'U') - datetime\format(StartDate, 'UTC', 'U')) / 60;
$hours = number\floor($durationMinutes / 60);
$minutes = ($durationMinutes / 60 - $hours) * 60;
NoofDays = string\concatenate($hours, ':', $minutes) / 24;
I used below method to calculate days between 2 date fields. I need to calculate and get days/hours/minutes for a field and it should show as Eg - 2 days 10 hour 30 minutes or like any easy way. Is it possible ?
$durationMinutes = (datetime\format(EndDate, 'UTC', 'U') - datetime\format(StartDate, 'UTC', 'U')) / 60;
$hours = number\floor($durationMinutes / 60);
$minutes = ($durationMinutes / 60 - $hours) * 60;
NoofDays = string\concatenate($hours, ':', $minutes) / 24;
Comment