Afficher l’heure en format 12 heures

Author:

Afficher,l'heure,en,format,12,heures
{filelink=5597}


import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;

public class HeureFormat12
{
  public static void main(String[] argv) throws Exception
  {
    // Format 12 heure
    Format formatter = new SimpleDateFormat("h");
    String h = formatter.format(new Date());
    System.out.println(h+" Heure(s)");
  }
}

A Voir sur le même Sujet:

  • mesexemples javascript afficher date et heure
  • heure afficher java

Leave a Reply

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