title: convert timestamp into current date in android
body: <p>I have a problem in displaying the date,I am getting timestamp as 1379487711 but as per this the actual time is  9/18/2013 12:31:51 PM  but it displays the time as 17-41-1970. How to show it as current time.</p>
  
  <p>for displaying time I have used the following method:</p>
  
  <pre><code>private String getDate(long milliSeconds) {
      // Create a DateFormatter object for displaying date in specified
      // format.
      SimpleDateFormat formatter = new SimpleDateFormat("dd-mm-yyyy");
      // Create a calendar object that will convert the date and time value in
      // milliseconds to date.
      Calendar calendar = Calendar.getInstance();
      calendar.setTimeInMillis((int) milliSeconds);
      return formatter.format(calendar.getTime());
  } 
  </code></pre>