-1

I am using below statement to display time.

Qt.formatTime(new Date(),"hh:mm:AP")

Is it possible to display time in 24 hour Format. If so how to do that?

demonplus
  • 5,613
  • 12
  • 49
  • 68
jay
  • 37
  • 2
  • 8

1 Answers1

0

I got answer following statement display time in 24 hr format:

Qt.formatTime(new Date(),"H:m: a")
demonplus
  • 5,613
  • 12
  • 49
  • 68
jay
  • 37
  • 2
  • 8
  • "a" in the format string should still have am/pm, just lowercase. For normal, i.e. 24 hours a day, formatting, just specify the hours and minutes without any extra. e.g. `hh:mm` – Kevin Krammer Nov 09 '16 at 18:13