Afficher la date en plusieurs formats

Author:


{filelink=6026}

import java.util.Date;
import java.util.Locale;

public class PrintfDateFormat {
  public static void main(String[] args) {

    System.out.printf("La � un format:  %tDn", new Date() );
    System.out.printf("La � un format:  %tFn", new Date() );
    System.out.printf("La � un format:  %trn", new Date() );
    System.out.printf("La � un format:  %tRn", new Date());
    System.out.printf("La � un format:  %tT", new Date());
  }

}
/*
 *La � un format:  08/22/11
La � un format:  2011-08-22
La � un format:  02:17:49 AM
La � un format:  02:17
La � un format:  02:17:49

 */

A Voir sur le même Sujet:

  • java formater les sortie %i
  • java maskformatter deux chiffres
  • la bibliothéque correspond à MessageFormat() en java
  • MaskFormatter nombre
  • source maskformatter
  • exemple MessageFormat
  • passer une chaine a maskformatter
  • messageformat lecture fichier java
  • maskformatter
  • maskformatter exemple

Leave a Reply

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