public static String formatTime(long time){
  SimpleDateFormat sdf=new SimpleDateFormat("h:mm a");
  Calendar c=Calendar.getInstance();
  c.setTimeInMillis(time * 1000);
  return sdf.format(c.getTime());
}

public static String formatTime ( long time ) { SimpleDateFormat sdf = new SimpleDateFormat ( "h:mm a" ) ; Calendar c = Calendar . getInstance ( ) ; c . setTimeInMillis ( time * 1000 ) ; return sdf . format ( c . getTime ( ) ) ; }
helper method to format the sunsrise and sunset time returned by the openweathermap call .
