24 hour format for the time

Hi, I would need to send a device time in a 24 hour format through APP.
The timer sensor in the app inventor is giving only MM/dd/YYYY HH:mm:ss a where HH is always 12hour format? How can I have `MM/dd/YYYY HH:mm:ss where HH is represented in 24 hours.

1 Like

In the Designer, the Clock component has a (?) link next to it, which pops up some documentation including this link:
https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

According to that link, k is the 24 hour format.

Dear ABG, that k in the format is giving some other result, like MM/dd/YYYY HH:mm:ss and k. For example, to show that time is 21.45 minutes it is showing like 05/13/2020 09:45:23 21. The 21 at end is kind of hint that 09 is indeed 21. This is confusing. What I really need is 05/13/2020 21:45:23.

I got it now, https://stackoverflow.com/questions/8907509/how-to-set-24-hours-format-for-date-on-java/8907538.

I was using small hh, instead, I supposed to use HH. Silly mistake. I am really sorry. Thanks, ABG for your help

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.