title: Format yyyy-MM-dd HH:mm:ss from String to date Format
body: <p>What I am encountering is quite peculiar.</p>
  
  <p>My Code:</p>
  
  <pre><code>   val aa = "2017-01-17 01:33:00"
      val bb = "04:33"
      val hour = bb.substring(0, bb.indexOf(":"))
      val mins = bb.substring(bb.indexOf(":") + 1, bb.length())
      val negatedmins = "-" + mins
      val ecoffsethour = hour.toLong
      val ecoffsetmins = negatedmins.toLong
      println(aa)
      val datetimeformatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
      val txn_post_date_hkt_date_parsed = LocalDateTime.parse(aa, datetimeformatter)
      println(txn_post_date_hkt_date_parsed)
      val minushours = txn_post_date_hkt_date_parsed.minusHours(ecoffsethour)
      println(minushours)
      val minusmins = minushours.minusMinutes(ecoffsetmins)
      println(minusmins)
      val offsetPostdateDiff = minusmins.toString().replace("T", " ")
      println(offsetPostdateDiff)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>2017-01-17 01:33:00
  2017-01-17T01:33
  2017-01-16T21:33
  2017-01-16T22:06
  2017-01-16 22:06
  </code></pre>
  
  <p>In the same code I am changing only the "aa" value to ==> <code>2017-01-17 01:33:44</code></p>
  
  <p>Now the output is :</p>
  
  <pre><code>2017-01-17 01:33:44
  2017-01-17T01:33:44
  2017-01-16T21:33:44
  2017-01-16T22:06:44
  2017-01-16 22:06:44
  </code></pre>
  
  <p>Why is the first method not taking seconds field into consideration?</p>
  
  <blockquote>
    <p>My Requirement is : However the output should come in "yyyy-MM-dd
    HH:mm:ss" format.</p>
  </blockquote>
  
  <p>I'm quite new to Scala. Please enlighten me.</p>