Classe ‘MessageFormat’: Afficher l’heure en format moyen (exemple: 16:05:42)

Author:


Download

 
import java.text.MessageFormat;
import java.util.Date;
 
public class HeureFormatMoyen {
  public static void main(String[] argv) throws Exception {
    Object[] data = new Object[] { new Date(), new Date(0) };
    String msg = MessageFormat.format("Heure Format Moyen:{0,time,medium} l''UTC {1,time,medium}", data);
 
    System.out.println(msg);
  }
}
 
/*
 * Sortie:
 * Heure Format Moyen:00:38:10 l'UTC 00:00:00
 *
 *
 /

Cet article Classe ‘MessageFormat’: Afficher l’heure en format moyen (exemple: 16:05:42) est apparu en premier sur .