Classe ‘MessageFormat’: Afficher l’heure en format long (Exemple: 16:07:33 GMT)

Author:


{filelink=5933}


import java.text.MessageFormat;
import java.util.Date;

public class HeureFormatLong {
  public static void main(String[] argv) throws Exception {
    Object[] params = new Object[] { new Date(), new Date(0) };
    String msg = MessageFormat.format("Heure Format Long:{0,time,long} l''UTC {1,time,long}", params);

    System.out.println(msg);
  }
}
//Heure Format Long:00:41:23 GMT l'UTC 00:00:00 GMT

A Voir sur le même Sujet:

  • messageformat format()
  • messageformat string long
  • maskformatter java

Leave a Reply

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