code: static public String getFormattedDateTime(long dt, TimeZone tz, String format)
      {
          SimpleDateFormat df = new SimpleDateFormat(format);
          if(tz != null)
              df.setTimeZone(tz);
          return df.format(new Date(dt));
      }
docs: Returns the given date time formatted using the given format and timezone.
  @param dt The date to format (in milliseconds)
  @param tz The timezone for the date (or null)
  @param format The format to use for the date
  @return The formatted date