In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Convert time in decimal [e.g 7.6 hours] to Time in hours and minutes 7:30

Learner_Kat
6 - Meteoroid

Hello All,

I am a newbie to Alteryx .I would like to know how to convert decimal time in hours to time in  hours:minutes(rounded)

E.g I need to convert 7.6 hours to 7:36 (7 hours: 36 minutes) 

 

7.5 hours to 7:30 minutes

6.17 hours to 6:10 minutes

 

Could somebody please guide.

Thanks in advance 

5 REPLIES 5
JosephSerpis
17 - Castor
17 - Castor

Hi @Learner_Kat I mocked up an approach using the formula todatetime I wasn't sure how you wanted to handle the seconds so came up with second approach to round the seconds to 00.

 

Decimal_Time_29072023.JPG

Learner_Kat
6 - Meteoroid

Hi ,

I need the 7.5 hours as 7:30 ( and not as 07:30:00) 

similarly 6.17 as 6:10  and so forth .

Any thoughts please 

JosephSerpis
17 - Castor
17 - Castor

Yes divide by 1440 which is the amount of minutes per day.

 

Decimal_Time_29072023_v1.JPG

Learner_Kat
6 - Meteoroid

Yes I did divide by 1440.i need it to display as 7:30 and not 00:07:30

Is there a way to change size of the data type time from 8(default)to 4 ( which I am guessing will change the format to 7:30)

 

JosephSerpis
17 - Castor
17 - Castor

You are going to have to change the datatype from a time format into a string format to achieve and use a left or right formula to extract.

 

Decimal_Time_29072023_v2.JPG

Labels
Top Solution Authors