Sunday, June 15, 2014

‘SimpleDateFormat’ - use it to display the current system date in ‘yyyy/MM/DD HH:mm:ss’ format?

public class CurrentSystemDate {
public static void main(String[] args) {
        SimpleDateFormat sysForm = new SimpleDateFormat("yyyy/MM/DD HH:mm:ss");
        Date curdate= new Date();
        System.out.println(sysForm.format(curdate));
}
}

No comments:

Post a Comment