I have a line of C# code that I am trying to replicate in Java. The code looks as follows.
n.InnerText = DateTime.Parse(n.InnerText).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ");
node.setTextContent = Date.parse(node.getTextContent())
You can use:
DateFormat format = new SimpleDateFormat("yyyy-MM-ddTHH:mm:ssZ"); Date date = format.parse(myString);
Be sure to check the locale if it's appropriate, and to check that the fields are the same (as I don't know what you intended to parse, I just copied them).
(For example "T" does not exist.)