import java.util.*;
import java.text.*;
public class HackDefence {
public static void main(String args[]) {
Date dateObject = new Date( );
//E represents day in week
//y represents year in 4 digit
//M represents month in year
//d represents day month
//h represents hour
//m represents minute in hour
//s represents second minute
SimpleDateFormat ft = new SimpleDateFormat ("E yyyy.MM.dd 'at' hh:mm:ss");
System.out.println("Right now Date: " + ft.format(dateObject));
}
}
OUTPUT:
import java.text.*;
public class HackDefence {
public static void main(String args[]) {
Date dateObject = new Date( );
//E represents day in week
//y represents year in 4 digit
//M represents month in year
//d represents day month
//h represents hour
//m represents minute in hour
//s represents second minute
SimpleDateFormat ft = new SimpleDateFormat ("E yyyy.MM.dd 'at' hh:mm:ss");
System.out.println("Right now Date: " + ft.format(dateObject));
}
}
OUTPUT:
No comments:
Post a Comment