Converting XX:XX AM/PM to 24 Hour Clock

前端 未结 6 1712
抹茶落季
抹茶落季 2021-02-15 16:41

I have searched google and I cannot find out how you can take a string: xx:xx AM/PM (ex. 3:30 PM) and change it so that it is now in 24 hours.

So for e

6条回答
  •  不思量自难忘°
    2021-02-15 17:16

    Mine did not work till I added Locale like this:

    SimpleDateFormat date12Format = new SimpleDateFormat("hh:mm aa", Locale.US);
    

提交回复
热议问题