import java.util.Date;
import java.util.Locale;
public class PrintfExamples {
public static void main(String[] args) {
System.out.printf("The date is %s\n", new Date() );
System.out.printf("The date is %tc\n", new Date() );
System.out.printf("The DATE is %Tc\n", new Date() );
}
}
/*
The date is Fri Oct 31 16:30:25 PDT 2008
The date is Fri Oct 31 16:30:25 PDT 2008
The DATE is FRI OCT 31 16:30:25 PDT 2008
*/
|