Afficher l’heure en format 24Heures

Author:


{filelink=5772}


import java.util.Calendar;
import java.util.Formatter;

public class Heure24Heures {
  public static void main(String[] argv) throws Exception {
    Formatter fmt = new Formatter();
    Calendar cal = Calendar.getInstance();

    fmt.format("L'heure (Format 24-heures): %tT", cal);
    System.out.println(fmt);

  }
}
//L'heure (Format 24-heures): 21:42:07

Leave a Reply

Your email address will not be published. Required fields are marked *