title: want current date and time in "dd/MM/yyyy HH:mm:ss.SS" format
body: <p>I am using following code to get date in "dd/MM/yyyy HH:mm:ss.SS" format.</p>
  
  <pre><code>    import java.text.SimpleDateFormat;
      import java.util.Calendar;
      import java.util.Date;
  
      public class DateAndTime{
  
      public static void main(String[] args)throws Exception{
  
      Calendar cal = Calendar.getInstance();
      SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss.SS");
      String strDate = sdf.format(cal.getTime());
      System.out.println("Current date in String Format: "+strDate);
  
      SimpleDateFormat sdf1 = new SimpleDateFormat();
      sdf1.applyPattern("dd/MM/yyyy HH:mm:ss.SS");
      Date date = sdf1.parse(strDate);
      System.out.println("Current date in Date Format: "+date);
  
  }
  }
  </code></pre>
  
  <p>and am getting following output</p>
  
  <pre><code>    Current date in String Format: 05/01/2012 21:10:17.287
      Current date in Date Format: Thu Jan 05 21:10:17 IST 2012
  </code></pre>
  
  <p>Kindly suggest what i should do to display the date in same string format(dd/MM/yyyy HH:mm:ss.SS) i.e i want following output:</p>
  
  <pre><code>    Current date in String Format: 05/01/2012 21:10:17.287
      Current date in Date Format: 05/01/2012 21:10:17.287
  </code></pre>
  
  <p>Kindly suggest</p>