What is the meaning of “%d:%02d” in `printf`?

Even though I’m not 100% sure what “%d:%02d” means

Here you go:

  • %d means an integer
  • : is a :
  • %02d means an integer, left padded with zeros up to 2 digits.

More info at https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html#syntax

Leave a Comment