Comparing two times in android

前端 未结 4 917
梦如初夏
梦如初夏 2021-01-02 23:57

I have tried with the below code to compare two times:

   SimpleDateFormat sdf = new SimpleDateFormat(\"hh:mm\");
    Date inTime = sdf.parse(\"11:00\");
            


        
4条回答
  •  醉酒成梦
    2021-01-03 00:38

    If you are using 24 hour time format then use kk instead of HH.

     SimpleDateFormat sdf = new SimpleDateFormat("kk:mm");
    

提交回复
热议问题