Stampare una data formattata in Java: Difference between revisions
Jump to navigation
Jump to search
m New page: http://technofriends.in/2008/05/01/how-to-print-datetime-in-a-given-format-in-java/ <pre> package testapplicationsfortechnofriends; import java.util.Date; import java.text.Sim... |
(No difference)
|
Latest revision as of 17:18, 19 May 2010
http://technofriends.in/2008/05/01/how-to-print-datetime-in-a-given-format-in-java/
package testapplicationsfortechnofriends;
import java.util.Date;
import java.text.SimpleDateFormat;
/**
*
* @author Vaibhav
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Date todaysDate = new java.util.Date();
SimpleDateFormat formatter = new SimpleDateFormat(“EEE, dd-MMM-yyyy HH:mm:ss”);
String formattedDate = formatter.format(todaysDate);
System.out.println(“Today’s date and Time is:”+formattedDate);
}
}