title: Converting Date time format in Java
body: <p>I have a line of C# code that I am trying to replicate in Java. The code looks as follows. </p>
  
  <pre><code>n.InnerText = DateTime.Parse(n.InnerText).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ");
  </code></pre>
  
  <p>The intent is to replace the DateTime already in the xml context with one representing universal time. </p>
  
  <p>I have attempted to use </p>
  
  <pre><code>node.setTextContent = Date.parse(node.getTextContent())
  </code></pre>
  
  <p>but I am unable to continue due to the Date.parse() being deprecated. I read through the note in Eclipse and tried DateFormat as suggested but DateFormat does not have a parse method. </p>
  
  <p>Can someone suggest a solution to my problem that does not use any third party libraries?</p>