title: How to get time in format HH:mm:ss from timestamp 20180805231400 -0300
body: <p>Below is my code but it throws an exception saying that unable to parse date format.</p>
  
  <pre><code>     try{
  
          DateFormat outputFormat = new SimpleDateFormat("yyyyMMddHHmmss zzzz", Locale.getDefault());
          DateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss", Locale.getDefault());
  
          String inputText = channelListArrayList.get(0).getTv().getProgramme().get(j).getStart();
          Date date = inputFormat.parse(inputText);
          String outputText = outputFormat.format(date);
  
        } catch (Exception e) {
           e.printStackTrace();
        }
  </code></pre>