title: Parse date to "yyyy-MM-dd'T'00:00:00" using Groovy
body: <p>I am trying to parse date format '2017-12-18T20:41:06.136Z' into "2017-12-18'T'00:00:00"</p>
  
  <pre><code>Date date = new Date();
  def dateformat =  new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
  dateformat.setTimeZone(TimeZone.getTimeZone(TimeZoneCode));
  def currentDate = dateformat.format(date)
  log.info "Current Date : " + currentDate
  date1 =  new SimpleDateFormat("yyyy-MM-dd'T'00:00:00").parse(currentDate)
  log.info "Current Date : " + date1
  </code></pre>
  
  <p>Error displayed :</p>
  
  <blockquote>
    <p>java.text.ParseException: Unparseable date: "2017-12-18T20:46:06:234Z" error at line: 16</p>
  </blockquote>
  
  <p>This line gives error :</p>
  
  <pre><code>date1 =  new SimpleDateFormat("yyyy-MM-dd'T'00:00:00").parse(currentDate)
  </code></pre>