cancel
Showing results for
Did you mean:
Level: Powered On

## Convert Hours in to Days and hour

Hi All.
I wanted to convert hours into days and hour. Ex - 75 into 3 days 3 hours.
I'm trying to achieve div(75,24) = 3.125.
I get the fraction value(.125) using split function.
Multiply reminder with 24 like mul(24,.125) but Mul expression does not accept the fraction value.
Please let me know how to convert hours into Days and hours

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Convert Hours in to Days and hour

The below expression should give you the output you need (where 75 is an example number of hours that can be replaced with a dynamic value).

concat(int(div(75,24)),' days and ',mod(75,24),' hours')

int(div(75,24)) will get the number of full days as an integer value removing the decimals. mod(75,24) will give you the remaining number of hours.
Hope that helps.

Proud to be a Flownaut!

2 REPLIES 2
Highlighted
Level: Powered On

## Re: Convert Hours in to Days and hour

Think you just need to use the mod function

mod(75, 24) gives you 3

https://docs.microsoft.com/en-gb/azure/logic-apps/workflow-definition-language-functions-reference#m...

Super User

## Re: Convert Hours in to Days and hour

The below expression should give you the output you need (where 75 is an example number of hours that can be replaced with a dynamic value).

concat(int(div(75,24)),' days and ',mod(75,24),' hours')

int(div(75,24)) will get the number of full days as an integer value removing the decimals. mod(75,24) will give you the remaining number of hours.
Hope that helps.

Proud to be a Flownaut!

Announcements

#### Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

#### New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

#### Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

#### Power Platform World Tour

Find out where you can attend!

#### Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (4,750)