How to convert integer in time string (hh:mm:ss)

I have an application that uses a chrnometer and compute seconds.
How to convert the seconds (integer) in hh:mm:ss format for display (and sharing) in a string?

More generaly speaking do we have a “C” like sprintf() function with % format ?

1 Like

You can learn from this link @fbd38
http://ai2.appinventor.mit.edu/reference/components/sensors.html#Clock

Salman Dev

1 Like

Salman,

I tried it but there is a problem with the TimeZone that creates an offset that we have to substract. This is a real convern if your application is supposed to run in different contries with different time zone.

I am looking for something simplest. Just convert any number (whatever the type) in hh:mm:ss string.

Regards

1 Like

mey be you need extension you can check an extension here @fbd38
https://puravidaapps.com/extensions.php

1 Like

Try this extension:

2 Likes

Example:

1 Like

Thanks a lot !

AI2 has time format items to give you those.
See https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html