From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

minute to hour convert

Solved!
Go to solution

hi,

      how to convert 150(int)minute to 02:30(string) hour minute.if any other method without this program.

0 Kudos
Message 1 of 12
(3,145 Views)

I prefer Scan from String (as I can do it "all at once"), but it is basically the equivalent of your code.  That's about as efficient as it comes ...

 

BS

0 Kudos
Message 2 of 12
(3,136 Views)
Solution
Accepted by topic author GokulGKM

@Bob_Schor wrote:

I prefer Scan from String (as I can do it "all at once")


I think you mean Format String in this case.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 12
(3,128 Views)

Use Format Into String with %.0t as format string.

 

Ben64

0 Kudos
Message 4 of 12
(3,106 Views)
Solution
Accepted by topic author GokulGKM

... and don't forget to multiply the minutes by 60 as seconds is the base unit for time conversions.

 

Ben64

0 Kudos
Message 5 of 12
(3,077 Views)

Oops ...  Of course I did.

 

BS

0 Kudos
Message 6 of 12
(3,056 Views)

hi,

      pls send me some example...

0 Kudos
Message 7 of 12
(3,028 Views)
Solution
Accepted by topic author GokulGKM

madhanskm wrote:  pls send me some example...

 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 12
(2,992 Views)
Solution
Accepted by topic author GokulGKM

@madhanskm wrote:

hi,

      pls send me some example...


mn to hr.png

 

Ben64

0 Kudos
Message 9 of 12
(2,975 Views)

I'm currently trying to do some verry similar...

 

Input: # of minutes to countdown

Output: countdown time string in HH:MM:SS format. (I realized the correct format is %02d right after I uploaded it)

 

pic of code (vi is attached V2014):

http://i.imgur.com/ssHGMI5.png

 

Is there a smarter way to do this where is skips the "00:01:60" count?

 

Thanks

-pat

 

0 Kudos
Message 10 of 12
(2,864 Views)