Getting the current time and date on a 24 hour timescale

前端 未结 3 751

I am having problems getting the current time on a 24 hour timescale. As far as I know, \"HH\" should represent the current hour on a 24 hour timescale, however, for some re

3条回答
  •  一个人的身影
    2020-12-10 14:21

    Try this:

          SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
          String s = sdf.format(new Date());
    

提交回复
热议问题