Classe ‘MessageFormat’: Utiliser un format personnalisé pour l’heure et la Date

Author:


{filelink=5935}


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

public class HeureFormatPersonnel {
  public static void main(String[] argv) throws Exception {
    Object[] data = new Object[] { new Date(), new Date(0) };
    String msg = MessageFormat.format("Heure Format personnel: {0,time,HH:mm:ss} l''UTC: {1,time,HH:mm:ss}", data);
     System.out.println(msg);
  }
}
// Heure Format personnel: 00:50:38 l'UTC: 00:00:00

A Voir sur le même Sujet:

  • enregistrer image format personalisé java
  • formatage date personnalisé java
  • comment+utiliser+MessageFormat+en+java
  • MessageFormat.format
  • maskformatter java

Leave a Reply

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