The two formats essentially do the same thing but differ in how they handle midnight
. kk
will format midnight
to 24:00
whereas HH
will format to 00:00
. The hours in a day in k
are 1-24
and in H
are 0-23
It's always worth checking the java documentation as it generally provides very useful explanations as well as examples of uses.