Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Java Programming Code Examples

Java > Java Util Package Code Examples

Use a SimpleDateFormat to print the date our way

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Use a SimpleDateFormat to print the date our way public class DateDemo { public static void main(String[] args) { //+ Date dNow = new Date(); /* Simple, Java 1.0 date printing */ System.out.println("It is now " + dNow.toString()); // Use a SimpleDateFormat to print the date our way. SimpleDateFormat formatter = new SimpleDateFormat ("E yyyy.MM.dd 'at' hh:mm:ss a zzz"); System.out.println("It is " + formatter.format(dNow)); //- } }