Java > Java Util Package
Use a SimpleDateFormat to print the date our way
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)); //- } }
Java Codes
Beginners
Core Java
Date Time
Java2D
Java Applets
Java AWT
Mathematics
Networking
Servlets
Session
Sound
Swing
Threads
Util Package
JDBC
Learning
Other
Security
XML