Java display current time

前端 未结 6 1901
一向
一向 2021-01-02 02:05

I have a code which shows me the current date and time when I run my application

DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");
Calen         


        
6条回答
  •  一生所求
    2021-01-02 03:05

    Use simple date formatter with hh:mm as format.

    SimpleDateFormat sdf = new SimpleDateFormat("HH:MM a");
    

    Click here for complete program.

提交回复
热议问题