title: Change date from MM/dd to yyyy-MM-dd'T'HH:mm:ss.SSZ in Java
body: <p>I have a String that formatted <code>MM/dd</code>. I would like to convert it to a Date in format <code>yyyy-MM-dd'T'HH:mm:ss.SSZ</code>.</p>
  <pre><code>DateFormat df = new SimpleDateFormat(&quot;MM/dd&quot;);
  String strDate = &quot;06/05&quot;;
  Date date = new Date();
  date = df.parse(strDate);
  </code></pre>
  <p>This makes it a Date, but in the original format.</p>
  <pre><code>System.out.println(new SimpleDateFormat(&quot;yyyy-MM-dd'T'HH:mm:ss.SSZ&quot;).format(date));
  </code></pre>
  <p>This returns the correct month and day, but nopthing else.</p>
  <pre><code>1970-06-05T00:00:00.00-0400
  </code></pre>
  <p>Any idea how I can make it return</p>
  <pre><code>CURRENT_YEAR-06-05TCURRENT_TIME
  </code></pre>