SimpleDateFormat returns 24-hour date: how to get 12-hour date?

前端 未结 9 2434
一生所求
一生所求 2020-12-08 06:41

I want current time in millis and then to store it in 12 hour format but with this piece of code I am getting 24 hour format time.

long timeInMillis = System         


        
9条回答
  •  孤街浪徒
    2020-12-08 06:57

    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/mm/yyyy hh:mm:ss a");
    

    use hh in place of HH

提交回复
热议问题