title: java.text.ParseException: Unparseable date Exception while converting timestamp value to time in java
body: <p>I want to convert a Timestamp value which is passed as String to SimpleDateFormat Object into Time Value but it throws a Unparseable date exception.</p>
  
  <pre><code>The Value which i am passing is Thu Jan 1 17:45:00 UTC+0530 1970
  </code></pre>
  
  <p>Bur i am getting an Exception as mentioned below:</p>
  
  <pre><code>java.text.ParseException: Unparseable date: "Thu Jan 1 17:45:00 UTC+0530 1970"
  </code></pre>
  
  <p>Please find the below code which i have implemented(Not Working):</p>
  
  <pre><code>static SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.US);
  static SimpleDateFormat inputFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.US);
  static SimpleDateFormat outputFormatTime = new SimpleDateFormat("HH:mm:ss");
  
  public static String convertUtcDateStringToTime(String utcDateValue) throws Exception
      {
          Date parsedDate = dateFormat.parse(utcDateValue);
          String returnDate=outputFormatTime.format(inputFormat.parse(parsedDate.toString()));
          return returnDate;
      }
  </code></pre>
  
  <p>If i use the below code it works fine for me(Working) but its a depreciated function of Date which i want to avoid..</p>
  
  <pre><code>@SuppressWarnings("deprecation")
  public static String convertUtcDateStringToTime(String utcDateValue) throws Exception
  {
      Date dateValue=new Date(utcDateValue);
      Date parsedDate = dateFormat.parse(dateValue.toString());
      String returnDate=outputFormatTime.format(inputFormat.parse(parsedDate.toString()));
      return returnDate;
  }
  </code></pre>
  
  <p>Please Guide Me To implement the logic where i have missed. Thanks in advance.</p>