title: Error in conversion of dates in java
body: <pre><code>String date = jsonobject.getString("needbydate");
  DateFormat df = new SimpleDateFormat("MMM/dd/yyyy");
  DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ");
  Date startDate = sdf.parse(date);
  String needbydate = df.format(startDate).toString()+"";
  </code></pre>
  
  <h2>What is happening::</h2>
  
  <ul>
  <li><strong>At the start</strong></li>
  </ul>
  
  <p><code>date</code>=<code>2014-12-17T21:37:00+00:00</code></p>
  
  <ul>
  <li><strong>At the end</strong></li>
  </ul>
  
  <p><code>needbydate</code>= Dec/18/2014</p>
  
  <p><code>17</code> is changed to <code>18</code> .... What wrong am i doing in conversion</p>
  
  <hr>
  
  <h2>EDIT:</h2>
  
  <pre><code>            String date=jsonobject.getString("needbydate");
              DateFormat df = new SimpleDateFormat("MMM/dd/yyyy",Locale.ENGLISH);
              DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss",Locale.ENGLISH);
              sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
              Date startDate;
              startDate = sdf.parse(date);
              needbydate = df.format(startDate).toString()+"";
  </code></pre>