cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlessandroP
Helper II
Helper II

How to convert string HH:MM in integer

Dear Experts

 

I have a csv file that provides a column called Time  in format HH:MM.

 

I need to feed the values of this column in a data connector and it accepts only INT32 data type.

 

How do I convert then from HH:MM into INT32 in Power Automate?

 

Any help would be highly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
jinivthakkar
Super User
Super User

@AlessandroP in continuation of yesterdays flow I have add following steps which gives me int value for HH and MM separately then you can use as required

 

jinivthakkar_0-1613390890328.png

 

Entire flow 

jinivthakkar_1-1613391028583.png

 

Refer this link for details of the flow : https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-convert-string-dd-mm-yyyy-hh-mm-to...

 

Hope this helps.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

5 REPLIES 5
jinivthakkar
Super User
Super User

@AlessandroP in continuation of yesterdays flow I have add following steps which gives me int value for HH and MM separately then you can use as required

 

jinivthakkar_0-1613390890328.png

 

Entire flow 

jinivthakkar_1-1613391028583.png

 

Refer this link for details of the flow : https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-convert-string-dd-mm-yyyy-hh-mm-to...

 

Hope this helps.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Paulie78
Super User
Super User

2021-02-15_12-21-52.png

AlessandroP
Helper II
Helper II

I don't think this is going to solve my issue 

 

I need to convert for example the time 23:32 into an integer.

I don't need to convert into integer 23 and 32.

I need the formula to convert the time into an integer.

AlessandroP
Helper II
Helper II

Now, I get it

 

essentially the field time is expressed in seconds therefore I need to calculate the number of seconds from the time expressed in hours and minutes.

Thanks to the splitting you suggested ,  I can bulid the formula  Number of hours * 3600 + number of minutes * 60

 

 

AlessandroP_0-1613432370767.png

 

Thank you for the help

 

AlessandroP
Helper II
Helper II

This is the formula I used 

add(mul(int(outputs('Split_Hours_and_minutes')[0]),3600),mul(int(outputs('Split_Hours_and_minutes')[1]),60))

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (4,521)