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");
The intent is to replace the DateTime already in the xml context with one representing universal time.
I have attempted to use
node.setTextContent = Date.parse(node.getTextContent())
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.
Can someone suggest a solution to my problem that does not use any third party libraries?