title: Add minutes to timestamp
body: <p>I need to add minutes into timestamp and return new value after that. Timestamp is taken from database and passed to method as String and has this pattern: yyyy-MM-dd hh:mm:ss.SSSSSS</p>
  
  <pre><code>public static String changeCreditTimeStampMin(String tmStmp, int minutesToAdd) {
  
      tmStmp = tmStmp.substring(0, tmStmp.length() - 3);
      try {
          SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
          java.util.Date parsedDate = dateFormat.parse(tmStmp);
          java.sql.Timestamp timestamp = new java.sql.Timestamp(parsedDate.getTime() + minutesToAdd*60*1000);
          tmStmp = timestamp.toString();
      } catch (ParseException e) {
          e.printStackTrace();
      }catch(Exception e){
          e.printStackTrace();
      }
      return tmStmp;
  }
  </code></pre>
  
  <p>As you can see, my logic uses SimpleDateFormat and in order to use that I have to use substring operation on timestamp. My question, is there any better way I could get the same result without cutting the timestamp string? Please note that my java version is 1.5 and I cannot use newer versions. </p>