Home » JAVA Programming » Basic Datatypes » Question
  1. How to format date from one form to another?
    1. DateFormat
    2. SimpleFormat
    3. DateConverter
    4. SimpleDateFormat
    5. None of these
Correct Option: D

SimpleDateFormat can be used as:


Date now = new Date();
SimpleDateFormat date = new SimpleDateFormat ("yyyy-mm-dd'T'hh:MM:ss");
String nowStr = date.format(now);
System.out.println("Current Date: " + );



Your comments will be displayed only after manual approval.